/* ============================================
   CSS VARIABLES - CLOVER THEME
   ============================================ */
:root {
  /* Brand Colors */
  --bg-body: #F6F8F3;
  /* Pale Organic Mint */
  --bg-white: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.7);

  /* Text Colors */
  --text-primary: #1A1A1A;
  /* Deep Charcoal */
  --text-secondary: #666666;
  --text-muted: #999999;

  /* Action Colors */
  --action-primary: #1A1A1A;
  /* Solid Black Buttons */
  --action-hover: #000000;
  --accent-green: #4CAF50;
  /* Vibrant Clover Green */

  /* Borders & Dividers */
  --border-color: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Border Radius - Softer & Friendlier */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows - Soft & Diffused */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.08);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Softer spring */
  --transition-bounce: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
header {
  background: var(--bg-glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
  position: relative;
}

.logo::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -8px;
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
}

.search-container {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.search-container input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  font-size: 15px;
  background: var(--bg-white);
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.search-container input:focus {
  outline: none;
  background: var(--bg-white);
  box-shadow: 0 0 0 2px var(--accent-green), var(--shadow-md);
}

.search-container::before {
  content: '🔍';
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.4;
  filter: grayscale(100%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.cart-btn {
  position: relative;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-sm);
}

.cart-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--action-primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 12px;
  min-width: 20px;
  border: 2px solid var(--bg-white);
}

/* ===== NAVIGATION ===== */
nav {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  padding-top: 8px;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  gap: 40px;
  overflow-x: auto;
}

.nav-link {
  padding: 16px 0;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--action-primary);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  transform: translateX(-50%) scaleX(0.5);
  /* Small aesthetic line */
}

/* ===== MAIN CONTAINER ===== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 32px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.filter-toggle {
  display: none;
}

.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 8px;
}

.filter-chip {
  padding: 10px 20px;
  background: var(--bg-white);
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.filter-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--action-primary);
  color: white;
  box-shadow: var(--shadow-md);
}

.sort-select {
  margin-left: auto;
  padding: 10px 36px 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-white);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  box-shadow: var(--shadow-sm);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231A1A1A' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: var(--transition-smooth);
}

.sort-select:hover {
  box-shadow: var(--shadow-md);
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  /* Soft floating card style */
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.5);
  /* Subtle white border highlight */
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-6px);
}

.product-image-container {
  position: relative;
  width: 100%;
  padding-top: 85%;
  /* Slightly taller for breathing room */
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%);
  overflow: hidden;
}

.product-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: auto;
  max-height: 85%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.product-card:hover .product-image {
  transform: translate(-50%, -55%) scale(1.08) rotate(-2deg);
}

.product-info {
  padding: 20px;
}

.product-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-category {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: inline-block;
  background: var(--bg-body);
  padding: 4px 8px;
  border-radius: 6px;
}

.product-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.product-lowest-ask {
  font-size: 12px;
  color: var(--text-secondary);
}

.quick-view-btn {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: var(--action-primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-md);
}

.product-card:hover .quick-view-btn {
  opacity: 1;
  transform: translateY(0);
}

.quick-view-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--action-hover);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--bg-white);
  border-radius: 24px;
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleUp {
  from {
    transform: scale(0.95);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: var(--bg-body);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition-bounce);
  color: var(--text-primary);
}

.modal-close:hover {
  background: #E5E5E5;
  transform: rotate(90deg);
}

.modal-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
}

.modal-image {
  width: 100%;
  height: 100%;
  min-height: 400px;
  background: var(--bg-body);
  object-fit: contain;
  padding: 40px;
}

.modal-details {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.modal-details h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.modal-category {
  font-size: 13px;
  color: var(--accent-green);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 24px;
  font-weight: 700;
}

.modal-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-lowest-ask {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  background: var(--bg-body);
  padding: 4px 10px;
  border-radius: 20px;
}

.size-selector {
  margin-bottom: 32px;
}

.size-selector h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.size-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.size-option {
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
}

.size-option:hover {
  border-color: var(--text-primary);
  transform: translateY(-2px);
}

.size-option.selected {
  background: var(--text-primary);
  color: white;
  border-color: var(--text-primary);
  box-shadow: var(--shadow-md);
}

.add-to-cart-btn {
  width: 100%;
  padding: 20px;
  background: var(--action-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.add-to-cart-btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--shadow-hover);
  background: var(--action-hover);
}

.add-to-cart-btn:active {
  transform: scale(0.96);
}

/* ===== CART MODAL ===== */
.cart-modal {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1100;
}

.cart-modal.active {
  display: block;
}

.cart-content {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  max-width: 480px;
  height: 100%;
  background: var(--bg-white);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.cart-header {
  padding: 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h2 {
  font-size: 24px;
  font-weight: 800;
}

.cart-close {
  background: var(--bg-body);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.cart-close:hover {
  transform: rotate(90deg);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
}

.cart-item {
  display: flex;
  gap: 20px;
  padding: 24px;
  margin-bottom: 16px;
  background: var(--bg-body);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  transition: var(--transition-smooth);
}

.cart-item:hover {
  background: #FFFFFF;
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  background: white;
  padding: 4px;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.3;
}

.cart-item-size {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  background: rgba(0, 0, 0, 0.05);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
}

.cart-item-price {
  font-size: 16px;
  font-weight: 700;
}

.remove-item {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
  margin-top: 8px;
  transition: color 0.2s;
}

.remove-item:hover {
  color: #DC3545;
}

.cart-footer {
  padding: 32px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-white);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.cart-total-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cart-total-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
}

.checkout-btn {
  width: 100%;
  padding: 20px;
  background: var(--action-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-bounce);
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.checkout-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  background: var(--action-hover);
}

.empty-cart {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-cart-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.2;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px;
  }

  .search-container {
    order: 3;
    max-width: 100%;
    flex-basis: 100%;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .modal-body {
    grid-template-columns: 1fr;
    padding: 0;
  }

  .modal-image {
    min-height: 250px;
    border-radius: 24px 24px 0 0;
  }

  .modal-details {
    padding: 32px;
  }

  .nav-container {
    padding: 0 16px;
  }

  .container {
    padding: 24px 16px;
  }
}
}

.logo {
  font-size: 24px;
}

.products-grid {
  gap: 8px;
}

.product-info {
  padding: 8px;
}

.product-name {
  font-size: 12px;
}

.product-price {
  font-size: 14px;
}
}

/* ===== UTILITIES ===== */
.hidden {
  display: none !important;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: var(--primary-green);
  color: white;
}