/* =========================================
   Kashmiri Dhaage - Main Stylesheet
   ========================================= */

:root {
  /* --- Color System --- */
  --color-bg-primary: #f8f5ef;
  /* Warm off-white */
  --color-bg-secondary: #ffffff;
  /* Pure white */
  --color-text-primary: #2a2a2a;
  /* Dark charcoal */
  --color-text-muted: #6b6b6b;
  /* Soft gray */
  --color-accent: #b89b5e;
  /* Heritage Gold */
  --color-beige: #efe8dc;
  /* Soft Beige */
  --color-border: #e0dbd0;

  /* --- Typography --- */
  --font-heading: 'Playfair Display', serif;
  /* Elegant serif */
  --font-body: 'Lato', sans-serif;
  /* Clean sans-serif */

  /* --- Spacing --- */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 8rem;

  /* --- Transitions --- */
  --transition-fast: 0.3s ease;
  --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Product Details Page --- */
.product-details-container {
  padding: 2rem 0 6rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

/* Gallery */
.pd-main-image {
  background-color: var(--color-beige);
  aspect-ratio: 3 / 4;
  overflow: hidden;
  margin-bottom: 1rem;
}

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

.pd-main-image:hover img {
  transform: scale(1.1);
  /* Zoom effect */
}

/* Info */
.pd-category {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.5rem;
}

.pd-info h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.pd-price {
  font-size: 1.5rem;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.pd-description-short {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-text-reading);
  margin-bottom: 2rem;
}

/* Selectors */
.pd-selectors {
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.selector-group label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
}

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

.size-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border);
  background: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.3s;
}

.size-btn:hover,
.size-btn.active {
  background-color: var(--color-text-primary);
  color: #fff;
  border-color: var(--color-text-primary);
}

.qty-selector {
  display: flex;
  border: 1px solid var(--color-border);
  height: 40px;
  width: 120px;
}

.qty-selector button {
  width: 30px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
}

.qty-selector input {
  width: 100%;
  border: none;
  text-align: center;
  font-size: 1rem;
  /* remove arrows */
  -moz-appearance: textfield;
}

.qty-selector input::-webkit-outer-spin-button,
.qty-selector input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Actions */
.pd-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

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

.btn-outline:hover {
  background: var(--color-text-primary);
  color: #fff;
}

/* Accordions */
.pd-accordions {
  border-top: 1px solid var(--color-border);
}

.pd-accordions details {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.pd-accordions summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 20px;
}

.pd-accordions summary::-webkit-details-marker {
  display: none;
}

.pd-accordions summary::after {
  content: '+';
  position: absolute;
  right: 0;
  font-weight: 300;
  font-size: 1.2rem;
}

.pd-accordions details[open] summary::after {
  content: '-';
}

.accordion-content {
  padding-top: 1rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}


/* --- Pre-Launch Modal --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #fff;
  padding: 3rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.modal-content h2 {
  font-family: var(--font-heading);
  margin-bottom: 1rem;
  color: var(--color-accent);
}

.modal-content p {
  margin-bottom: 1.5rem;
  color: var(--color-text-reading);
}

.modal-newsletter {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.modal-newsletter input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid var(--color-border);
}

@media (max-width: 768px) {
  .product-details-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 1rem;
    /* Less padding on mobile */
  }

  .pd-info h1 {
    font-size: 2rem;
  }

  .modal-newsletter {
    flex-direction: column;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text-primary);
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

ul {
  list-style: none;
}

/* --- Utilities --- */
.container {
  width: 90%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--spacing-sm);
}

.section {
  padding: var(--spacing-xl) 0;
}

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

.uppercase {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 0.9rem;
  letter-spacing: 0.1rem;
  text-transform: uppercase;
  border: 1px solid var(--color-text-primary);
  background: transparent;
  color: var(--color-text-primary);
  transition: all var(--transition-fast);
}

.btn:hover {
  background: var(--color-text-primary);
  color: var(--color-bg-secondary);
}

/* --- Add to Bag / Shop Now Button (High Visibility) --- */
.add-to-bag,
.shop-now-btn {
  background-color: #ffffff;
  color: var(--color-text-primary);
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  /* Lift it up */
  transition: all 0.3s ease;
}

.add-to-bag:hover,
.shop-now-btn:hover {
  background-color: var(--color-accent);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* White Button for Hero/Dark Backgrounds */
.btn-white {
  border-color: #ffffff;
  color: #ffffff;
}

.btn-white:hover {
  background-color: #ffffff;
  color: var(--color-text-primary);
}

.btn-accent {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

.btn-accent:hover {
  background-color: #a0854d;
  border-color: #a0854d;
}

.page-hero {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  color: #ffffff;
  margin-bottom: 0;
  height: 100vh;
}

.page-hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  /* Consistent with homepage */
  z-index: 1;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 var(--spacing-sm);
}

.page-hero-content h1 {
  font-size: 4rem;
  /* Match Homepage */
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.page-hero-content p {
  font-size: 1.3rem;
  /* Match Homepage */
  color: #f1f1f1;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  letter-spacing: 0.05em;
  max-width: 800px;
  /* Match Homepage max-width */
  margin: 0 auto;
}

/* Height Modifiers */
/* Height overrides removed as .page-hero now defaults to 100vh */

.hero-cart {
  height: 50vh;
  background-color: var(--color-text-primary);
  /* Dark Charcoal */
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
  /* Clear fixed header */
  margin-bottom: 4rem;
  /* Spacing below */
  background-image: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3));
  /* Subtle overlay */
}

.hero-cart .page-hero-content h1 {
  font-size: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0;
}

@media (max-width: 768px) {
  .hero-cart {
    height: 40vh;
  }

  .hero-cart .page-hero-content h1 {
    font-size: 2rem;
  }
}

/* Responsive Adjustments for Page Hero */
@media (max-width: 768px) {
  .page-hero-content h1 {
    font-size: 2.5rem;
  }

  /* Remove explicit mobile height reduction to maintain full impact, 
   or keep it if homepage has it. Homepage has no media query reducing height, 
   so we keep it 100vh here too. */
}

/* --- Shopping Cart Page --- */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 3rem;
}

.cart-table th,
.cart-table td {
  padding: 1.5rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.cart-table th {
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.cart-product-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.cart-product-info img {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-product-info h4 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.qty-input {
  width: 60px;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  text-align: center;
}

.cart-summary {
  display: flex;
  justify-content: flex-end;
}

.cart-totals {
  width: 100%;
  max-width: 400px;
  background-color: #fcfcfc;
  padding: 2rem;
  border: 1px solid var(--color-border);
  text-align: right;
}

.cart-totals h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.tax-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.checkout-btn {
  width: 100%;
  margin-bottom: 1rem;
}

.continue-shopping {
  font-size: 0.9rem;
  text-decoration: underline;
  color: var(--color-text-muted);
}

/* Mobile Cart */
@media (max-width: 768px) {
  .cart-table thead {
    display: none;
  }

  .cart-table tr {
    display: block;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
  }

  .cart-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border: none;
  }

  .cart-table td::before {
    content: attr(data-label);
    font-weight: 700;
    margin-right: 1rem;
    color: var(--color-text-primary);
  }

  .cart-product-info {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }

  .cart-product-info img {
    width: 60px;
    height: 75px;
  }

  .cart-totals {
    width: 100%;
    max-width: none;
    /* Full width on mobile */
    text-align: center;
  }

  .cart-summary {
    justify-content: center;
  }
}