/* CSS Variables */
:root {
  --primary: #004D40;
  /* Pilgrim Deep Teal */
  --primary-light: #00695C;
  --accent: #FFD700;
  /* Gold/Yellow for CTA */
  --accent-hover: #FBC02D;
  --text-main: #1C1C1C;
  /* Softer black */
  --text-light: #666666;
  --bg-white: #FFFFFF;
  --bg-off-white: #F8F9FA;
  --border-color: #EAEAEA;
  --font-main: 'Montserrat', sans-serif;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --spacing-section: 100px;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-white);
  color: var(--text-main);
  line-height: 1.7;
  /* Improved readability */
  padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Prevent horizontal scroll */
}

html {
  overflow-x: hidden;
  /* Prevent horizontal scroll on html element too */
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

ul {
  list-style: none;
}

/* Utilities */
.container {
  max-width: 1300px;
  /* Wider container */
  margin: 0 auto;
  padding: 0 40px;
}

.section-padding {
  padding: var(--spacing-section) 0;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.content-between {
  justify-content: space-between;
}

.gap-20 {
  gap: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  border-radius: 4px;
  /* Slight radius */
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 77, 64, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 77, 64, 0.3);
}

.btn-accent {
  background-color: var(--accent);
  color: var(--text-main);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
}

.btn-outline {
  border: 1px solid var(--text-main);
  background: transparent;
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--text-main);
  color: white;
}

.btn-block {
  width: 100%;
}

/* Premium Button Animations */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Header */
.main-header {
  height: 80px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: all 0.3s;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--primary);
  transition: 0.3s;
}

.nav-links a:hover::after {
  width: 100%;
}

.header-actions {
  display: flex;
  gap: 25px;
  font-size: 1.2rem;
  color: var(--text-main);
}

.badge {
  background: var(--primary);
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 50%;
  position: absolute;
  top: -8px;
  right: -10px;
  font-weight: 700;
}

/* Product Card Badge - More Prominent */
.product-card .badge {
  position: absolute;
  top: 15px;
  left: 15px;
  right: auto;
  background: var(--accent);
  color: var(--text-main);
  font-size: 0.7rem;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 1px;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Page Headers / Hero */
.page-header {
  background: var(--bg-off-white);
  padding: 80px 0;
  text-align: center;
  margin-bottom: 60px;
}

.page-title {
  font-size: 3rem;
  font-weight: 300;
  /* Light weight for elegance */
  margin-bottom: 10px;
}

.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Product Cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.product-card {
  background: transparent;
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
  /* Fill grid cell */
}

.product-image-wrapper {
  width: 100%;
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  /* White background for transparent/contained images */
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #f5f5f5;
  /* Subtle border */
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* Show full image */
  transition: transform 0.5s ease;
  padding: 10px;
  /* Breathing room */
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  /* Takes remaining space */
}

.product-title {
  font-size: 1rem;
  margin-bottom: 8px;
  font-weight: 500;
  line-height: 1.4;
  /* Line Clamping */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.8em;
  /* Force height for alignment */
}

.product-price {
  font-weight: 600;
  color: var(--primary);
  font-size: 0.95rem;
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
}

.product-price .original {
  text-decoration: line-through;
  color: #999;
  font-weight: 400;
  font-size: 0.85rem;
}

.product-info .btn {
  margin-top: auto;
  /* Pushes button to bottom */
}

/* Category Cards (Homepage) */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.category-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 1/1;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}

.category-card:hover img {
  transform: scale(1.1);
}

.category-card .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
}

.category-card:hover .overlay {
  background: rgba(0, 0, 0, 0.4);
}

.category-card h3 {
  color: white;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* =========================================
   Testimonials Section - Modern Design
   ========================================= */
.testimonials-section {
  position: relative;
  overflow: hidden;
}

.testimonials-subtitle {
  max-width: 600px;
  margin: 0 auto 50px;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 100%;
}

.testimonial-card {
  background: white;
  padding: 35px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid transparent;
}

.testimonial-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 77, 64, 0.15);
  border-color: var(--primary-light);
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 20px;
  left: 25px;
  font-size: 5rem;
  color: var(--primary-light);
  opacity: 0.1;
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-stars {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 1.3rem;
  letter-spacing: 3px;
}

.testimonial-text {
  color: #555;
  line-height: 1.8;
  margin-bottom: 25px;
  font-style: italic;
  font-size: 1rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.author-avatar {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.3rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 77, 64, 0.2);
  transition: transform 0.3s ease;
}

.testimonial-card:hover .author-avatar {
  transform: scale(1.1) rotate(5deg);
}

.author-info {
  flex: 1;
}

.author-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.author-location {
  font-size: 0.9rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 5px;
}

.author-location::before {
  content: '📍';
  font-size: 0.85rem;
}

/* Product Detail Page */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  /* Image larger */
  gap: 60px;
  margin-top: 40px;
}

.product-gallery {
  position: sticky;
  top: 100px;
  height: fit-content;
  display: grid;
  gap: 20px;
}

.gallery-main img {
  width: 100%;
  border-radius: var(--radius);
}

.product-content h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.product-rating {
  color: var(--accent);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.product-price-large {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}

.product-description {
  color: var(--text-light);
  margin-bottom: 30px;
  font-size: 1.05rem;
}

.quantity-add {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
}

.qty-btn-group {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

.qty-btn-group button {
  background: none;
  border: none;
  padding: 0 15px;
  font-size: 1.2rem;
  cursor: pointer;
}

.qty-btn-group input {
  width: 50px;
  text-align: center;
  border: none;
  font-size: 1rem;
  font-weight: 600;
}

.accordion-item {
  border-top: 1px solid var(--border-color);
}

.accordion-header {
  padding: 20px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
}

.accordion-body {
  padding-bottom: 20px;
  color: var(--text-light);
  display: none;
  font-size: 0.9rem;
}

.accordion-item.active .accordion-body {
  display: block;
}

.accordion-item:last-child {
  border-bottom: 1px solid var(--border-color);
}

/* =========================================
   Cart Drawer - Consolidated
   ========================================= */
.cart-drawer {
  width: 450px;
  background: white;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  /* Above header */
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(2px);
}

.cart-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  padding: 25px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.close-drawer {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  color: #555;
  transition: color 0.2s;
}

.close-drawer:hover {
  color: black;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 25px;
}

.drawer-footer {
  padding: 25px;
  border-top: 1px solid #eee;
  background: #f9f9f9;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

/* Cart Items */
.cart-item {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cart-item img {
  width: 90px;
  height: 110px;
  /* Portrait aspect */
  border-radius: 4px;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-info h4 {
  font-size: 0.95rem;
  margin-bottom: 5px;
  line-height: 1.4;
  font-weight: 500;
}

.cart-item-price {
  font-weight: 600;
  color: var(--primary);
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: auto;
  /* Push to bottom */
}

.qty-controls button {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.qty-controls button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.qty-controls .remove-btn {
  border: none;
  margin-left: auto;
  color: #999;
}

.qty-controls .remove-btn:hover {
  color: #d32f2f;
  border: none;
}


/* =========================================
   Footer - Premium Dark Theme
   ========================================= */
.main-footer {
  background: #050505;
  color: #e0e0e0;
  padding: 80px 0 30px;
  font-size: 0.9rem;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 50px;
  margin-bottom: 70px;
}

.footer-col h4 {
  font-size: 0.8rem;
  letter-spacing: 2px;
  margin-bottom: 30px;
  color: #666;
  /* Muted label */
  text-transform: uppercase;
  font-weight: 700;
}

.footer-col ul li {
  margin-bottom: 14px;
}

.footer-col ul li a {
  color: #bbb;
  font-size: 0.95rem;
  position: relative;
  padding-left: 0;
  transition: all 0.3s;
}

.footer-col ul li a:hover {
  color: white;
  padding-left: 5px;
}

.social-links {
  display: flex;
  gap: 15px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  transition: 0.3s;
}

.social-links a:hover {
  background: white;
  border-color: white;
  color: black;
  transform: translateY(-3px);
}

.copyright {
  border-top: 1px solid #222;
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  color: #555;
  font-size: 0.8rem;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  /* Hero adjustments for tablet */
  .hero h1 {
    font-size: 2.8rem !important;
  }

  /* Testimonials - 2 columns on tablet */
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px !important;
  }
}

/* Small tablets and large phones */
@media (max-width: 900px) {
  .container {
    padding: 0 30px;
  }

  /* Benefits bar - 2 columns */
  section div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 25px !important;
  }
}


@media (max-width: 768px) {

  /* CRITICAL: Prevent horizontal scroll */
  * {
    max-width: 100%;
  }

  body,
  html {
    overflow-x: hidden !important;
    width: 100%;
  }

  .container {
    padding: 0 20px;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Ensure all sections don't overflow */
  section {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  .main-header {
    padding: 0 20px;
    height: 70px;
    max-width: 100vw;
  }

  body {
    padding-top: 70px;
  }

  .nav-links {
    display: none;
    /* In production, needs a mobile menu */
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  /* Hero Section Mobile */
  .hero {
    min-height: auto !important;
    padding: 40px 0 !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  .hero .container {
    flex-direction: column !important;
    gap: 30px !important;
    max-width: 100% !important;
  }

  .hero .hero-text {
    flex: none !important;
    width: 100%;
    max-width: 100%;
  }

  .hero .hero-text span {
    font-size: 0.75rem !important;
    margin-bottom: 15px !important;
  }

  .hero h1 {
    font-size: 1.8rem !important;
    margin-bottom: 20px !important;
    max-width: 100%;
  }

  .hero .hero-text p {
    font-size: 0.95rem !important;
    margin-bottom: 25px !important;
    max-width: 100% !important;
  }

  .hero .hero-text>div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    font-size: 0.8rem !important;
    max-width: 100%;
  }

  .hero .hero-image {
    flex: none !important;
    width: 100%;
    max-width: 100%;
    height: 300px !important;
  }

  .hero .hero-image img {
    box-shadow: 10px 10px 0 var(--primary-light) !important;
    max-width: 100%;
  }

  /* Testimonials Section Mobile */
  .section-padding {
    padding: 60px 0;
    overflow-x: hidden !important;
  }

  .section-title {
    font-size: 1.8rem !important;
    margin-bottom: 30px !important;
  }

  /* Testimonials - Single column on mobile */
  .testimonials-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .testimonial-card {
    padding: 25px !important;
  }

  .testimonial-card::before {
    font-size: 3.5rem !important;
    top: 15px !important;
    left: 20px !important;
  }

  .testimonial-stars {
    font-size: 1.1rem !important;
    margin-bottom: 15px !important;
  }

  .testimonial-text {
    font-size: 0.95rem !important;
    margin-bottom: 20px !important;
  }

  .author-avatar {
    width: 45px !important;
    height: 45px !important;
    font-size: 1.1rem !important;
  }

  .author-name {
    font-size: 0.95rem !important;
  }

  .author-location {
    font-size: 0.85rem !important;
  }

  /* Benefits Bar - Stack on Mobile */
  section div[style*="grid-template-columns: repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 30px !important;
    max-width: 100% !important;
  }

  /* Reviews ticker */
  div[style*="overflow: hidden"] {
    max-width: 100vw !important;
  }

  .cart-drawer {
    width: 100%;
    /* Full width on mobile */
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  /* Product page - no sticky on mobile */
  .product-detail-layout>div {
    position: static !important;
    top: auto !important;
  }

  /* Adjust button sizes */
  .btn {
    padding: 12px 24px;
    font-size: 0.8rem;
    max-width: 100%;
  }

  /* Page headers */
  .page-header {
    padding: 50px 0;
    margin-bottom: 40px;
  }

  .page-title {
    font-size: 2rem !important;
  }

  /* Shop page filters - Stack on mobile */
  .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px !important;
    margin-top: 15px;
  }

  .filters a {
    margin-left: 0 !important;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    font-size: 0.85rem;
  }

  /* Shop breadcrumb/filter container */
  div[style*="justify-content: space-between"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 15px;
  }

  /* Ensure images don't overflow */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Desktop only - sticky product info */
@media (min-width: 1025px) {
  .product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
  }

  .product-content {
    position: sticky;
    top: 100px;
  }
}

/* =========================================
   Chapter 4: Landing Page Psychology
   CTA & Animation Enhancements
   ========================================= */

/* CTA Hover Effect */
.btn-primary:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 30px rgba(255, 107, 53, 0.6) !important;
}

/* Pulse Animation for Real-Time Indicators */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.1);
  }
}