/* Base styles */
:root {
  --primary: hsl(340, 68%, 69%);
  --primary-foreground: hsl(0, 0%, 100%);
  --secondary: hsl(340, 68%, 84%);
  --secondary-foreground: hsl(240, 10%, 15%);
  --muted: hsl(240, 5%, 96%);
  --muted-foreground: hsl(240, 4%, 46%);
  --accent: hsl(350, 100%, 50%);
  --accent-foreground: hsl(0, 0%, 100%);
  --background: hsl(0, 0%, 100%);
  --foreground: hsl(240, 10%, 15%);
  --card: hsl(0, 0%, 100%);
  --card-foreground: hsl(240, 10%, 15%);
  --popover: hsl(0, 0%, 100%);
  --popover-foreground: hsl(240, 10%, 15%);
  --destructive: hsl(0, 84%, 60%);
  --destructive-foreground: hsl(0, 0%, 100%);
  --border: hsl(240, 6%, 90%);
  --input: hsl(240, 6%, 90%);
  --ring: hsl(340, 68%, 69%);
  --radius: 0.5rem; /* Standard border radius */

  /* Brand specific colors */
  --kissna-pink: #e67a9e;
  --kissna-pink-light: #f3b9cb;
  --kissna-pink-lightest: #fdf0f4; /* Lighter pink for subtle backgrounds */
  --kissna-accent: #ff0032; /* Was previously defined, keep if used */
  --kissna-green: #25D366; /* WhatsApp Green */
}

/* Global styles & Resets */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased; /* Smoother fonts */
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: var(--foreground);
  background-color: var(--background);
  line-height: 1.6; /* Improved readability */
}

/* Prevent body scrolling when modal or drawer is open */
body.modal-open,
body.drawer-open {
overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.3; /* Tighter line height for headings */
  font-weight: 600; /* Default heading weight */
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--kissna-pink);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary); /* Use primary pink on hover for links */
  text-decoration: underline;
}

/* Layout Container */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem; /* Consistent padding */
  padding-right: 1rem;
}

/* Header & Navigation */
.header {
  background-color: var(--card); /* Use card background */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100; /* Ensure it's above content, below modals */
  border-bottom: 1px solid var(--border);
}

.logo-container {
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem; /* Adjusted padding */
  background-color: var(--kissna-pink-lightest);
}

.logo {
  height: 70px; /* Slightly adjusted */
  object-fit: contain;
}

.nav-container {
  display: flex;
  justify-content: center; /* Center desktop nav by default */
  align-items: center;
  padding: 0 1rem;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 60px; /* Ensure nav container has height */
}

/* Desktop Navigation */
.nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0.5rem 0; /* Reduced padding */
  gap: 2rem; /* Increased gap */
  list-style: none; /* Remove default list styling if it were a ul */
}

.nav-item {
  position: relative;
  color: var(--foreground);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  font-size: 0.9rem;
  text-transform: uppercase;
  padding: 0.5rem 0; /* Add padding for larger clickable area */
}

.nav-item:hover {
  color: var(--kissna-pink);
  text-decoration: none; /* Remove underline on hover */
}

.nav-item::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--kissna-pink);
  bottom: 0px; /* Position underline closer */
  left: 50%;
  transform: translateX(-50%);
  transition: width 0.3s ease-out;
}

.nav-item:hover::after {
  width: 70%; /* Underline doesn't span full width */
}

/* Mobile Menu Button */
.mobile-menu-button {
  display: none; /* Hidden on desktop */
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem;
}

.menu-icon {
  width: 28px; /* Slightly larger icon */
  height: 28px;
}

/* Drawer Navigation */
.drawer-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1050; /* Above header, below modal */
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0s linear 0.3s, opacity 0.3s ease;
}

.drawer-container.open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6); /* Darker overlay */
  cursor: pointer;
}

.drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 80%; /* Wider drawer */
  max-width: 320px;
  height: 100%;
  background-color: var(--background);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smoother transition */
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
}

.drawer-container.open .drawer-content {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s;
}
.drawer-close:hover {
  color: var(--foreground);
}

.close-icon {
  width: 24px;
  height: 24px;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.25rem; /* Increased padding */
  gap: 0.5rem; /* Reduced gap */
  overflow-y: auto;
  flex-grow: 1;
}

.drawer-nav-item {
  color: var(--foreground);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0.8rem 0; /* Adjusted padding */
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.drawer-nav-item:last-child {
 border-bottom: none;
}

.drawer-nav-item:hover {
  color: var(--kissna-pink);
}

/* Main Content Area */
main.container {
  padding-top: 2rem; /* Add space below header */
  padding-bottom: 3rem; /* Add space above footer */
}

/* Product Grid (Shared) */
.products-grid {
  display: grid;
  gap: 1.5rem; /* Consistent gap */
  /* Columns defined per section (category, related, progressive) */
}

/* Product Card (Shared) */
.product-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  display: flex;
  flex-direction: column;
  text-align: center; /* Center text content */
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.07);
}

.product-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%; /* Ensure link fills card */
}

.product-card-image {
  width: 100%;
  aspect-ratio: 1 / 1; /* Square images */
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.product-card .card-content { /* Wrapper for text content */
  padding: 0.75rem;
  margin-top: auto; /* Push content to bottom if card heights vary */
}

.product-card-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--kissna-pink);
  margin-bottom: 0.25rem; /* Space between price and size */
}

.product-card-size {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* Category Page Specific */
.category-title {
  text-align: center;
  margin-top: 1rem; /* Adjusted */
  margin-bottom: 2.5rem; /* Adjusted */
  font-size: clamp(1.8rem, 6vw, 2.5rem);
  font-weight: 700; /* Bolder */
  color: var(--foreground);
}
.size-section {
  margin-bottom: 3.5rem; /* More space between size sections */
}
.size-title {
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: 600; /* Bolder */
  margin-bottom: 2rem; /* More space below title */
  border-bottom: 3px solid var(--kissna-pink-light); /* Thicker border */
  padding-bottom: 0.75rem;
  color: var(--secondary-foreground);
}
.category-page .products-grid { /* Target grid specifically on category page */
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

/* Item Page Specific */
.product-section {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem; /* Increased gap */
  margin-bottom: 3rem;
}

.product-gallery {
  flex: 1 1 50%; /* Try 50/50 split */
  min-width: 300px; /* Prevent excessive squishing */
  max-width: 600px; /* Limit gallery width */
}

.main-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  margin-bottom: 1rem;
  /* cursor handled by JS */
}

#productImageLoadingText { /* Style for loading text placeholder */
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted-foreground);
  min-height: 400px; /* Approximate height of main image */
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background-color: var(--muted);
}

.thumbnail-container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem; /* Space above thumbnails */
}

.thumbnail {
  width: 75px; /* Adjusted size */
  height: 75px;
  border-radius: calc(var(--radius) / 2); /* Slightly less rounded */
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent; /* Transparent border initially */
  transition: all 0.2s ease;
  opacity: 0.8;
}
.thumbnail:hover {
  opacity: 1;
  border-color: var(--kissna-pink-light);
}
.thumbnail.active {
  border-color: var(--kissna-pink);
  opacity: 1;
  box-shadow: 0 0 5px rgba(230, 122, 158, 0.5); /* Subtle glow when active */
}

.product-info {
  flex: 1 1 45%; /* Try 45% */
  min-width: 300px;
  padding-left: 1rem; /* Add some padding when next to gallery */
}
@media (max-width: 768px) {
  .product-info { padding-left: 0; } /* Remove padding when stacked */
  .product-gallery { max-width: 100%; } /* Allow gallery full width when stacked */
}

.product-title {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-bottom: 0.5rem; /* Closer to price */
  font-weight: 700;
}

.product-price {
  font-size: clamp(1.5rem, 4.5vw, 1.9rem);
  color: var(--kissna-pink);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.product-description {
  font-size: 1rem;
  line-height: 1.7; /* Slightly more line height */
  margin-bottom: 2rem;
  color: var(--secondary-foreground);
}

.product-request {
  font-size: 0.9rem;
  margin-bottom: 2rem;
  color: #555;
  background-color: var(--kissna-pink-lightest);
  padding: 1rem;
  border-left: 4px solid var(--kissna-pink-light);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Size Selector */
.size-selector {
  margin-bottom: 2rem;
}
.size-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.size-options {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.size-option {
  min-width: 48px; /* Slightly wider */
  height: 40px; /* Slightly shorter */
  display: inline-flex; /* Use inline-flex */
  align-items: center;
  justify-content: center;
  padding: 0 1rem; /* Horizontal padding */
  border: 1px solid var(--border); /* Thinner border */
  border-radius: var(--radius);
  font-weight: 500; /* Slightly lighter weight */
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--card);
  color: var(--card-foreground);
}
.size-option:hover {
  border-color: var(--kissna-pink);
  color: var(--kissna-pink);
  background-color: var(--kissna-pink-lightest);
}
.size-option.selected {
  border-color: var(--kissna-pink);
  background-color: var(--kissna-pink);
  color: var(--primary-foreground); /* Use variable for white */
  font-weight: 600;
}

/* Buy Button (WhatsApp) */
.buy-button {
  width: 100%;
  padding: 0.9rem 1.5rem; /* Adjusted padding */
  /* background-color: var(--kissna-green); WhatsApp green */
  background-color: var(--kissna-pink); /* Or use brand pink */
  color: var(--primary-foreground);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s, box-shadow 0.2s, transform 0.1s;
  margin-bottom: 2rem;
  letter-spacing: 0.5px;
  display: inline-flex; /* Align icon and text */
  align-items: center;
  justify-content: center;
  gap: 0.75rem; /* Space between icon and text */
}
.buy-button:disabled {
  background-color: var(--muted-foreground);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.buy-button:not(:disabled):hover {
  /* background-color: #128C7E; Darker WhatsApp green */
  background-color: #d16a8d; /* Darker pink */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.buy-button:not(:disabled):active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); /* Inset shadow on click */
}
.buy-button svg {
  width: 1.2em; /* Icon size relative to font */
  height: 1.2em;
}

/* Services */
.services {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.service-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--secondary-foreground);
}
.service-icon {
  width: 24px;
  height: 24px;
  opacity: 0.7;
  flex-shrink: 0;
}

/* Related & Progressive Sections */
.related-products,
.progressive-products {
  margin-top: 4rem; /* More space */
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.related-title,
.progressive-title {
  text-align: center;
  margin-bottom: 2.5rem; /* More space */
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 1.9rem);
  color: var(--foreground);
}
.related-products-container {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.progressive-products .products-grid { /* Target progressive grid */
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* Slightly smaller cards */
}

/* Loading Indicator */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 0; /* More padding */
  min-height: 100px;
  text-align: center;
}
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem; /* More gap */
  color: var(--muted-foreground);
  font-size: 1rem;
}
.spinner { /* Defined here for completeness */
  width: 32px; /* Larger spinner */
  height: 32px;
  border: 4px solid var(--kissna-pink-lightest); /* Lighter border */
  border-radius: 50%;
  border-top-color: var(--kissna-pink);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-container p { font-size: 1rem; padding: 1rem; }
.loading-container .text-gray-500 { color: var(--muted-foreground); }
.loading-container .text-red-500 { color: var(--destructive); }

/* Footer */
.footer {
  background-color: var(--muted);
  padding: 2.5rem 1rem; /* More padding */
  margin-top: 4rem; /* More space */
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--kissna-pink);
  color: var(--primary-foreground);
  width: 44px; /* Adjusted size */
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  border: none;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8); /* Start smaller */
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 900; /* Below drawer/modal */
}
.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1); /* Scale in */
}
.scroll-to-top:hover {
  background-color: var(--primary); /* Use primary pink */
  transform: scale(1.1); /* Scale up on hover */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}
.scroll-to-top svg {
  width: 20px;
  height: 20px;
   stroke-width: 2.5;
}

/* Modal Styles */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.85); /* Darker */
display: none; /* Controlled by JS */
justify-content: center;
align-items: center;
z-index: 1100;
padding: 20px;
cursor: zoom-out;
}
/* JS should add/remove a class like 'flex' or set display directly */
.modal-overlay.flex { display: flex; }

.modal-content {
max-width: 95%; /* Allow slightly larger */
max-height: 90vh;
width: auto;
height: auto;
object-fit: contain;
display: block;
border-radius: 4px;
box-shadow: 0 8px 25px rgba(0,0,0,0.4);
cursor: default;
}

.modal-close {
position: absolute;
top: 15px;
right: 25px;
color: #fff;
font-size: 36px; /* Adjusted size */
font-weight: bold;
cursor: pointer;
line-height: 1;
text-shadow: 0 1px 3px rgba(0,0,0,0.6);
transition: color 0.2s, transform 0.2s;
}
.modal-close:hover {
color: #ccc;
transform: scale(1.1);
}

/* Responsive Media Queries */
@media (max-width: 992px) {
   .nav { gap: 1.5rem; }
   .product-section { gap: 2rem; }
   .product-gallery { flex-basis: calc(50% - 1rem); } /* Adjust flex basis */
   .product-info { flex-basis: calc(50% - 1rem); padding-left: 0; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-menu-button { display: block; }
  .nav-container { justify-content: flex-end; } /* Ensure button aligns right */
  .product-section { flex-direction: column; gap: 1.5rem; }
  .product-info { padding-left: 0; } /* Reset padding */
  .logo { height: 60px; }
  .related-products-container,
  .progressive-products .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); /* Adjust for tablets */
  }
}

@media (max-width: 480px) {
  .container { width: 95%; padding: 0 0.75rem; }
  .thumbnail { width: 60px; height: 60px; }
  .thumbnail-container { gap: 0.5rem; justify-content: flex-start; } /* Align left */
  .size-options { gap: 0.5rem; }
  .size-option { min-width: 40px; height: 36px; font-size: 0.9rem; padding: 0 0.75rem; }
  .related-products-container,
  .progressive-products .products-grid {
       grid-template-columns: repeat(2, 1fr); /* Force 2 columns */
       gap: 1rem;
   }
  .scroll-to-top { bottom: 1rem; right: 1rem; width: 40px; height: 40px; }
  .scroll-to-top svg { width: 18px; height: 18px; }
  .footer { padding: 2rem 1rem; }
  .category-title { font-size: 1.6rem; }
  .size-title { font-size: 1.3rem; }
  .product-title { font-size: 1.5rem; }
  .product-price { font-size: 1.4rem; }
  .buy-button { font-size: 0.95rem; padding: 0.8rem 1.2rem; }
}