/* Global Variables & Theme */
:root {
  --primary: #15803d; /* green-700 */
  --primary-foreground: #f0fdf4; /* green-50 */
  --secondary: #f3f4f6; /* gray-100 */
  --secondary-foreground: #1f2937; /* gray-800 */
  --background: #fdfbf7; /* Off-white/Cream */
  --foreground: #1c1917; /* stone-900 */
  --muted: #f5f5f4; /* stone-100 */
  --muted-foreground: #78716c; /* stone-500 */
  --border: #e7e5e4; /* stone-200 */
  --radius: 0.75rem;
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

button {
  cursor: pointer;
  font-family: inherit;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(253, 251, 247, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.nav-links {
  display: none;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  color: var(--foreground);
  transition: background-color 0.2s;
  position: relative;
}

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

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: var(--primary);
  color: white;
  font-size: 0.625rem;
  font-weight: bold;
  height: 1rem;
  width: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero Section */
.hero {
  padding: 4rem 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero {
    flex-direction: row;
    padding: 6rem 0;
    text-align: left;
  }
  .hero-content {
    flex: 1;
    padding-right: 2rem;
  }
  .hero-image {
    flex: 1;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--foreground);
}

.hero p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  margin-bottom: 2rem;
  max-width: 600px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

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

.hero-img-container {
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Product Grid */
.products-section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 2rem;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  background-color: white;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid transparent;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: var(--border);
}

.product-image {
  position: relative;
  aspect-ratio: 1;
  background-color: var(--muted);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  transform: translateY(100%);
  transition: transform 0.3s;
  display: flex;
  justify-content: center;
}

.product-card:hover .product-overlay {
  transform: translateY(0);
}

.product-info {
  padding: 1.25rem;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
}

.product-title {
  font-weight: 600;
  font-size: 1rem;
}

.product-price {
  font-weight: 700;
  color: var(--primary);
}

.product-type {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.product-meta {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.meta-tag {
  font-size: 0.7rem;
  padding: 0.125rem 0.5rem;
  background-color: var(--secondary);
  border-radius: 4px;
  color: var(--secondary-foreground);
}

/* Cart Drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background-color: white;
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
}

.cart-open .cart-overlay {
  opacity: 1;
  visibility: visible;
}

.cart-open .cart-drawer {
  transform: translateX(0);
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  /* Ensure minimum height but allow shrinking */
  min-height: 0;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.cart-item-img {
  width: 5rem;
  height: 5rem;
  border-radius: 0.5rem;
  object-fit: cover;
  background-color: var(--muted);
}

.cart-item-details {
  flex: 1;
}

.cart-item-title {
  font-weight: 500;
  font-size: 0.875rem;
}

.cart-item-price {
  font-weight: 600;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 4px;
  font-size: 1rem;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  background-color: var(--muted);
  /* Allow footer to scroll if content is too tall */
  overflow-y: auto;
  max-height: 60vh;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

/* Footer */
footer {
  background-color: white;
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-col h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary);
}

.copyright {
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Utilities */
.hidden { display: none; }
.text-center { text-align: center; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }

/* Pack Selector Styles */
.pack-selector {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.pack-options {
  display: flex;
  gap: 0.5rem;
}

.pack-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--background);
  border: 1.5px solid var(--border);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--foreground);
}

.pack-btn:hover {
  border-color: var(--primary);
  background: var(--muted);
}

.pack-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pack-btn:active {
  transform: scale(0.98);
}


/* Search and Sort Controls */
.controls-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-container {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  color: var(--foreground);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  pointer-events: none;
}

.sort-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-container label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.sort-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  color: var(--foreground);
  cursor: pointer;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Product Badges */
.product-badges {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.product-badge {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Product Tags */
.product-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
}

.tag-label {
  color: var(--muted-foreground);
  font-weight: 500;
}

.effect-tag-small, .flavor-tag-small {
  background: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.flavor-tag-small {
  background: #f0f9ff;
  color: #0369a1;
}

/* Strain Detail Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-content {
  background: white;
  border-radius: 16px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}

.modal-close:hover {
  background: rgba(0,0,0,0.7);
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

.modal-image {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.modal-image img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.modal-info h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--foreground);
}

.badges-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.badge-tag {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
}

.strain-type {
  color: var(--muted-foreground);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: var(--secondary);
  border-radius: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.detail-value {
  font-size: 1.125rem;
  color: var(--foreground);
  font-weight: 600;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--foreground);
}

.tags-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.effect-tag, .flavor-tag {
  background: var(--secondary);
  color: var(--secondary-foreground);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

.flavor-tag {
  background: #f0f9ff;
  color: #0369a1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .controls-bar {
    flex-direction: column;
  }
  
  .search-container {
    width: 100%;
  }
  
  .sort-container {
    width: 100%;
    justify-content: space-between;
  }
  
  .sort-select {
    flex: 1;
  }
  
  .modal-body {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  
  .modal-image {
    position: relative;
    top: 0;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* Pack Selector Styles */
.pack-selector {
  margin-top: 1rem;
}

.pack-options {
  display: flex;
  gap: 0.5rem;
}

.pack-btn {
  flex: 1;
  padding: 0.5rem;
  border: 2px solid var(--border);
  background: white;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
}

.pack-btn:hover {
  border-color: var(--primary);
  background: var(--primary-foreground);
}

.pack-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.w-full {
  width: 100%;
}

.mb-4 {
  margin-bottom: 1rem;
}

.text-center {
  text-align: center;
}
