/* ===========================
   GOOGLE FONT
=========================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* ===========================
   CSS VARIABLES — Light Mode
=========================== */

:root {
  --primary:       #2563eb;
  --primary-hover: #1e40af;
  --secondary:     #10b981;
  --secondary-hover: #059669;
  --accent:        #f59e0b;

  --bg:            #f8fafc;
  --bg-card:       #ffffff;
  --bg-nav:        #ffffff;

  --text:          #111827;
  --text-muted:    #6b7280;
  --text-light:    #ffffff;

  --border:        #e5e7eb;
  --shadow:        0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover:  0 10px 30px rgba(37, 99, 235, 0.15);

  --radius:        12px;
  --radius-sm:     8px;
}

/* ===========================
   DARK MODE VARIABLES
=========================== */

body.dark {
  --bg:            #0f172a;
  --bg-card:       #1e293b;
  --bg-nav:        #1e293b;

  --text:          #f1f5f9;
  --text-muted:    #94a3b8;
  --border:        #334155;
  --shadow:        0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-hover:  0 10px 30px rgba(37, 99, 235, 0.25);
}

/* ===========================
   RESET
=========================== */

*, *::before, *::after {
  margin:     0;
  padding:    0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:      'Poppins', sans-serif;
  background:       var(--bg);
  color:            var(--text);
  line-height:      1.6;
  transition:       background 0.3s ease, color 0.3s ease;
}

img {
  width:   100%;
  display: block;
}

a {
  text-decoration: none;
  color:           inherit;
}

ul {
  list-style: none;
}

button, input, select {
  font-family: inherit;
  outline:     none;
}

/* ===========================
   CONTAINER
=========================== */

.container {
  width:     90%;
  max-width: 1200px;
  margin:    auto;
}

/* ===========================
   SECTION
=========================== */

section {
  padding: 75px 0;
}

.section-title {
  font-size:     2rem;
  font-weight:   700;
  text-align:    center;
  margin-bottom: 50px;
  color:         var(--text);
  position:      relative;
}

.section-title::after {
  content:    '';
  display:    block;
  width:      60px;
  height:     4px;
  background: var(--primary);
  margin:     12px auto 0;
  border-radius: 2px;
}

/* ===========================
   BUTTON
=========================== */

.btn {
  display:       inline-block;
  padding:       12px 26px;
  border:        none;
  border-radius: var(--radius-sm);
  background:    var(--primary);
  color:         #fff;
  font-weight:   600;
  font-size:     14px;
  cursor:        pointer;
  transition:    background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
  text-align:    center;
  letter-spacing: 0.3px;
}

.btn:hover {
  background:  var(--primary-hover);
  transform:   translateY(-2px);
  box-shadow:  var(--shadow-hover);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: var(--secondary);
}

.btn.secondary:hover {
  background: var(--secondary-hover);
}

/* ===========================
   HEADER
=========================== */

.header {
  background:  var(--bg-nav);
  box-shadow:  var(--shadow);
  position:    sticky;
  top:         0;
  z-index:     1000;
  transition:  background 0.3s ease, box-shadow 0.3s ease;
}

/* ===========================
   NAVBAR
=========================== */

.navbar {
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  height:          72px;
}

.logo h2 {
  font-size:   1.8rem;
  font-weight: 800;
  color:       var(--primary);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap:     28px;
}

.nav-links a {
  font-weight:  500;
  color:        var(--text);
  position:     relative;
  transition:   color 0.25s;
}

.nav-links a::after {
  content:      '';
  position:     absolute;
  bottom:       -4px;
  left:         0;
  width:        0;
  height:       2px;
  background:   var(--primary);
  transition:   width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-right {
  display:     flex;
  align-items: center;
  gap:         14px;
}

/* ===========================
   SEARCH BOX
=========================== */

.search-box {
  width:         220px;
  padding:       9px 14px;
  border:        1px solid var(--border);
  border-radius: var(--radius-sm);
  background:    var(--bg);
  color:         var(--text);
  font-size:     14px;
  transition:    border-color 0.25s, box-shadow 0.25s;
}

.search-box:focus {
  border-color: var(--primary);
  box-shadow:   0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ===========================
   CART BUTTON & BADGE
=========================== */

.cart-btn {
  position:   relative;
  font-size:  24px;
  color:      var(--text);
  transition: transform 0.2s;
}

.cart-btn:hover {
  transform: scale(1.1);
}

.badge {
  position:      absolute;
  top:           -8px;
  right:         -10px;
  background:    #ef4444;
  color:         white;
  width:         20px;
  height:        20px;
  border-radius: 50%;
  display:       flex;
  justify-content: center;
  align-items:   center;
  font-size:     11px;
  font-weight:   700;
  border:        2px solid var(--bg-nav);
}

/* ===========================
   DARK MODE BUTTON
=========================== */

.dark-btn {
  width:           38px;
  height:          38px;
  border-radius:   50%;
  display:         flex;
  justify-content: center;
  align-items:     center;
  font-size:       18px;
  cursor:          pointer;
  border:          1px solid var(--border);
  background:      var(--bg);
  color:           var(--text);
  transition:      background 0.25s, transform 0.2s;
  user-select:     none;
}

.dark-btn:hover {
  background:  var(--border);
  transform:   rotate(20deg);
}

/* ===========================
   HAMBURGER MENU
=========================== */

.hamburger {
  display:         none;
  flex-direction:  column;
  justify-content: space-between;
  width:           26px;
  height:          20px;
  cursor:          pointer;
  background:      none;
  border:          none;
  padding:         0;
}

.hamburger span {
  display:       block;
  width:         100%;
  height:        2px;
  background:    var(--text);
  border-radius: 2px;
  transition:    all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform:        rotate(45deg) translate(5px, 9px);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -9px);
}

/* ===========================
   MOBILE NAV OVERLAY
=========================== */

.nav-mobile-menu {
  display:         none;
  flex-direction:  column;
  align-items:     center;
  gap:             0;
  background:      var(--bg-nav);
  border-top:      1px solid var(--border);
  padding:         0;
  max-height:      0;
  overflow:        hidden;
  transition:      max-height 0.35s ease, padding 0.35s ease;
}

.nav-mobile-menu.open {
  max-height: 300px;
  padding:    16px 0;
}

.nav-mobile-menu a {
  display:     block;
  padding:     12px 24px;
  font-weight: 500;
  color:       var(--text);
  width:       100%;
  text-align:  center;
  transition:  background 0.2s;
}

.nav-mobile-menu a:hover,
.nav-mobile-menu a.active {
  background: var(--bg);
  color:      var(--primary);
}

/* ===========================
   CARDS (shared)
=========================== */

.product-card,
.category-card,
.why-card {
  background:    var(--bg-card);
  border-radius: var(--radius);
  box-shadow:    var(--shadow);
  transition:    transform 0.3s ease, box-shadow 0.3s ease;
  overflow:      hidden;
}

.product-card:hover,
.category-card:hover,
.why-card:hover {
  transform:  translateY(-6px);
  box-shadow: var(--shadow-hover);
}

/* ===========================
   PRODUCT CARD — Enhanced
=========================== */

.product-card-img-wrap {
  position: relative;
  overflow: hidden;
}

.product-card-img-wrap img {
  height:     230px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product-card:hover .product-card-img-wrap img {
  transform: scale(1.06);
}

.product-badge {
  position:      absolute;
  top:           12px;
  left:          12px;
  background:    var(--primary);
  color:         #fff;
  font-size:     11px;
  font-weight:   600;
  padding:       4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.product-card-body {
  padding: 18px;
}

.product-card-body h3 {
  font-size:     17px;
  font-weight:   600;
  margin-bottom: 6px;
  color:         var(--text);
}

.product-card-body .price {
  font-size:     22px;
  font-weight:   700;
  color:         var(--primary);
  margin:        8px 0 14px;
}

/* ===========================
   STAR RATING
=========================== */

.star-rating {
  color:       var(--accent);
  font-size:   15px;
  margin-bottom: 6px;
}

.star-rating span {
  color:     var(--text-muted);
  font-size: 13px;
  margin-left: 4px;
}

/* ===========================
   CARD ACTIONS
=========================== */

.card-actions {
  display:   flex;
  gap:       10px;
  flex-wrap: wrap;
}

.card-actions .btn {
  flex:      1;
  min-width: 100px;
  padding:   10px 16px;
  font-size: 13px;
}

/* ===========================
   GRIDS
=========================== */

.product-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:                   25px;
}

.category-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap:                   20px;
}

.why-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap:                   20px;
}

/* ===========================
   CATEGORY CARD
=========================== */

.category-card {
  text-align: center;
  cursor:     pointer;
  padding:    24px 16px;
}

.category-card img {
  width:         80px;
  height:        80px;
  object-fit:    cover;
  border-radius: 12px;
  margin:        0 auto 14px;
  transition:    transform 0.3s;
}

.category-card:hover img {
  transform: scale(1.08);
}

.category-card h3 {
  font-size:  16px;
  font-weight: 600;
  color:      var(--text);
}

/* ===========================
   WHY CARD
=========================== */

.why-card {
  text-align: center;
  padding:    30px 20px;
}

.why-card h3 {
  font-size:     20px;
  font-weight:   600;
  margin-bottom: 12px;
  color:         var(--text);
}

.why-card p {
  color: var(--text-muted);
}

/* ===========================
   NEWSLETTER
=========================== */

.newsletter {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color:      white;
  text-align: center;
}

.newsletter h2 {
  font-size:     2rem;
  margin-bottom: 12px;
}

.newsletter p {
  opacity:       0.88;
  margin-bottom: 28px;
  font-size:     16px;
}

.newsletter-form {
  display:         flex;
  justify-content: center;
  align-items:     center;
  gap:             12px;
  flex-wrap:       wrap;
}

.newsletter-form input {
  width:         340px;
  max-width:     90%;
  padding:       13px 18px;
  border:        none;
  border-radius: var(--radius-sm);
  font-size:     15px;
  color:         #111;
}

.newsletter-form .btn {
  background: #fff;
  color:      var(--primary);
  font-weight: 700;
}

.newsletter-form .btn:hover {
  background: #f1f5f9;
}

/* ===========================
   PAGE HEADER (subpages)
=========================== */

.page-header {
  background: linear-gradient(135deg, #eef4ff 0%, #dbeafe 100%);
  padding:    70px 0;
  text-align: center;
}

body.dark .page-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.page-header h1 {
  font-size:     2.5rem;
  font-weight:   800;
  color:         var(--text);
  margin-bottom: 10px;
}

.page-header p {
  color:     var(--text-muted);
  font-size: 17px;
}

/* ===========================
   FOOTER
=========================== */

footer {
  background: #0f172a;
  color:      #cbd5e1;
  padding:    60px 0 0;
}

.footer-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap:                   30px;
  padding-bottom:        40px;
}

.footer-grid h3 {
  font-size:     17px;
  font-weight:   700;
  color:         #f1f5f9;
  margin-bottom: 18px;
}

.footer-grid p {
  line-height:   1.8;
  font-size:     14px;
}

.footer-grid ul li {
  margin: 8px 0;
}

.footer-grid ul li a {
  color:      #94a3b8;
  font-size:  14px;
  transition: color 0.2s;
}

.footer-grid ul li a:hover {
  color: var(--primary);
}

.footer-brand h3 {
  font-size: 22px;
  color:     #f1f5f9;
}

.footer-brand p {
  color:      #94a3b8;
  margin-top: 8px;
}

.copyright {
  text-align:    center;
  border-top:    1px solid rgba(255, 255, 255, 0.1);
  padding:       20px 0;
  color:         #64748b;
  font-size:     13px;
  margin-top:    0;
}

/* ===========================
   TOAST NOTIFICATION
=========================== */

.toast {
  position:      fixed;
  bottom:        30px;
  right:         30px;
  background:    #1e293b;
  color:         #fff;
  padding:       14px 22px;
  border-radius: var(--radius-sm);
  box-shadow:    0 8px 30px rgba(0, 0, 0, 0.25);
  font-size:     14px;
  font-weight:   500;
  z-index:       9999;
  max-width:     340px;
  opacity:       0;
  transform:     translateY(20px);
  transition:    opacity 0.35s ease, transform 0.35s ease;
  border-left:   4px solid var(--secondary);
}

.toast.show {
  opacity:   1;
  transform: translateY(0);
}

.toast.toast-error {
  border-left-color: #ef4444;
}

body.dark .toast {
  background: #334155;
}

/* ===========================
   RESPONSIVE — 992px
=========================== */

@media (max-width: 992px) {

  .search-box {
    width: 180px;
  }

}

/* ===========================
   RESPONSIVE — 768px
=========================== */

@media (max-width: 768px) {

  /* Show hamburger, hide desktop nav */
  .hamburger    { display: flex; }
  .nav-links    { display: none; }
  .search-box   { display: none; }
  .nav-mobile-menu { display: flex; }

  .navbar { height: 64px; }

  .section-title { font-size: 1.7rem; }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .toast {
    bottom:    16px;
    right:     16px;
    left:      16px;
    max-width: none;
  }

}

/* ===========================
   RESPONSIVE — 480px
=========================== */

@media (max-width: 480px) {

  .section-title { font-size: 1.5rem; }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .page-header h1 { font-size: 1.8rem; }

  .card-actions {
    flex-direction: column;
  }

  .card-actions .btn {
    width: 100%;
  }

}