/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #6C5CE7;
  --primary-dark: #5849C2;
  --accent: #00B894;
  --dark: #2D3436;
  --gray: #636E72;
  --light: #F5F6FA;
  --white: #FFFFFF;
  --border: #E1E4E8;
  --danger: #E74C3C;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  background: var(--light);
  line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
img { max-width: 100%; display: block; }

/* ===== Header ===== */
#header {
  background: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 20px;
}
.logo {
  font-size: 24px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.logo-icon { font-size: 28px; }
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-weight: 500;
  color: var(--gray);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--primary); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.search-box {
  position: relative;
}
.search-box input {
  padding: 9px 36px 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  width: 220px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus { border-color: var(--primary); }
.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--gray);
}
.cart-btn {
  background: var(--primary);
  color: var(--white);
  padding: 9px 18px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}
.cart-btn:hover { background: var(--primary-dark); }
.cart-count {
  background: var(--white);
  color: var(--primary);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.menu-toggle {
  display: none;
  font-size: 22px;
  background: none;
  color: var(--dark);
}

/* ===== Pages ===== */
.page { display: none; min-height: 50vh; }
.page.active { display: block; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
  color: var(--white);
  padding: 80px 0;
  text-align: center;
}
.hero-content { max-width: 700px; margin: 0 auto; }
.hero h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero h1 .accent { color: #FFEAA7; }
.hero p {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 30px;
}
.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
}
.btn-primary {
  background: var(--white);
  color: var(--primary);
  padding: 13px 32px;
  border-radius: 28px;
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
  padding: 11px 30px;
  border-radius: 28px;
  font-weight: 700;
  font-size: 16px;
  transition: background 0.2s;
}
.btn-outline:hover { background: rgba(255,255,255,0.15); }

/* ===== Features ===== */
.features {
  background: var(--white);
  padding: 40px 0;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.feature-card {
  text-align: center;
  padding: 24px;
}
.feature-icon { font-size: 40px; margin-bottom: 12px; }
.feature-card h3 { font-size: 18px; margin-bottom: 4px; }
.feature-card p { color: var(--gray); font-size: 14px; }

/* ===== Sections ===== */
.section { padding: 50px 0; }
.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 36px;
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
}
.section-header .section-title { margin-bottom: 0; }
.see-all {
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
}

/* ===== Categories ===== */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.category-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.category-card .cat-icon { font-size: 48px; margin-bottom: 12px; }
.category-card h3 { font-size: 18px; margin-bottom: 4px; }
.category-card p { color: var(--gray); font-size: 13px; }

/* ===== Products ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.product-image {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  background: var(--light);
}
.product-info { padding: 16px; }
.product-category {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.product-name {
  font-size: 16px;
  font-weight: 600;
  margin: 4px 0 6px;
}
.product-rating {
  font-size: 13px;
  color: #FDCB6E;
  margin-bottom: 8px;
}
.product-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
}
.product-old-price {
  font-size: 14px;
  color: var(--gray);
  text-decoration: line-through;
  margin-left: 6px;
  font-weight: 400;
}
.add-to-cart-btn {
  width: 100%;
  background: var(--primary);
  color: var(--white);
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-top: 12px;
  transition: background 0.2s;
}
.add-to-cart-btn:hover { background: var(--primary-dark); }

/* ===== Newsletter ===== */
.newsletter {
  background: var(--dark);
  color: var(--white);
  padding: 50px 0;
  text-align: center;
}
.newsletter-inner { max-width: 560px; margin: 0 auto; }
.newsletter h2 { font-size: 28px; margin-bottom: 10px; }
.newsletter p { opacity: 0.8; margin-bottom: 24px; }
.newsletter form {
  display: flex;
  gap: 10px;
}
.newsletter input {
  flex: 1;
  padding: 13px 18px;
  border: none;
  border-radius: 28px;
  font-size: 15px;
  outline: none;
}
.newsletter .btn-primary {
  background: var(--primary);
  color: var(--white);
  white-space: nowrap;
}

/* ===== Shop Page ===== */
.shop-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
}
.filters {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  height: fit-content;
  box-shadow: var(--shadow);
}
.filters h3 {
  font-size: 16px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.filters h3:not(:first-child) { margin-top: 24px; }
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray);
  transition: color 0.2s;
}
.filter-option:hover { color: var(--primary); }
.filter-option input { accent-color: var(--primary); }
.price-filter input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
#priceLabel {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  color: var(--gray);
  font-weight: 600;
}

/* ===== Product Detail ===== */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.product-detail-image {
  background: var(--white);
  border-radius: var(--radius);
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 140px;
  box-shadow: var(--shadow);
}
.product-detail-info h2 { font-size: 28px; margin-bottom: 10px; }
.product-detail-info .product-category { font-size: 14px; }
.product-detail-info .product-rating { font-size: 16px; margin: 10px 0; }
.product-detail-price {
  font-size: 32px;
  font-weight: 700;
  margin: 16px 0;
}
.product-detail-desc {
  color: var(--gray);
  margin-bottom: 24px;
  line-height: 1.7;
}
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.quantity-selector button {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--light);
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}
.quantity-selector span {
  font-size: 18px;
  font-weight: 600;
  min-width: 30px;
  text-align: center;
}
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary);
  font-weight: 600;
}

/* ===== About Page ===== */
.about-content { max-width: 800px; margin: 0 auto; }
.about-content p {
  font-size: 17px;
  color: var(--gray);
  margin-bottom: 20px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card h3 { font-size: 32px; color: var(--primary); }
.stat-card p { color: var(--gray); font-size: 14px; margin-top: 4px; }

/* ===== Contact Page ===== */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}
.contact-info {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}
.contact-info h3 { font-size: 20px; margin-bottom: 20px; }
.contact-info p { margin-bottom: 14px; font-size: 15px; color: var(--gray); }
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-form input,
.contact-form textarea {
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--primary); }
.contact-form .btn-primary { align-self: flex-start; }

/* ===== Cart Drawer ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: var(--white);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  box-shadow: -4px 0 30px rgba(0,0,0,0.15);
}
.cart-drawer.open { right: 0; }
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.cart-header h3 { font-size: 20px; }
.close-cart {
  background: none;
  font-size: 20px;
  color: var(--gray);
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-image {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 14px; margin-bottom: 4px; }
.cart-item-price { color: var(--primary); font-weight: 700; font-size: 14px; }
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.cart-item-qty button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--light);
  font-size: 14px;
  font-weight: 700;
}
.cart-item-remove {
  background: none;
  color: var(--danger);
  font-size: 13px;
  margin-left: auto;
}
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray);
}
.cart-empty span { font-size: 48px; display: block; margin-bottom: 12px; }
.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.checkout-btn { width: 100%; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--dark);
  color: var(--white);
  padding: 14px 28px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  box-shadow: var(--shadow-lg);
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Footer ===== */
footer {
  background: var(--dark);
  color: var(--white);
  padding: 50px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 40px;
}
.footer-col h4 { font-size: 18px; margin-bottom: 16px; }
.footer-col p { opacity: 0.7; font-size: 14px; line-height: 1.7; }
.footer-col a {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-bottom: 10px;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--white); }
.social-links {
  display: flex;
  gap: 14px;
}
.social-links a { font-size: 24px; }
.footer-bottom {
  text-align: center;
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 14px;
  opacity: 0.6;
}

/* ===== Responsive ===== */
@media (max-width: 968px) {
  .features-grid, .categories-grid, .products-grid, .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .shop-layout { grid-template-columns: 1fr; }
  .product-detail-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: block; }
  .search-box input { width: 160px; }
  .hero h1 { font-size: 36px; }
}
@media (max-width: 568px) {
  .features-grid, .categories-grid, .products-grid, .stats-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid { grid-template-columns: 1fr; }
  .search-box { display: none; }
  .hero h1 { font-size: 28px; }
  .hero-buttons { flex-direction: column; }
  .newsletter form { flex-direction: column; }
  .section-header { flex-direction: column; gap: 12px; }
}
