/* css/style.css - High Contrast, Accessible E-Commerce Styles */

:root {
  /* Colors */
  --header-dark: #1a1a1a;
  --logo-text: #1a1a1a;
  --nav-text: #1a1a1a;
  --search-btn: #005fa3;   /* Darkened from #0077C8 for AA contrast on white */
  --hero-blue: #7BCFE9;
  --alert-box-bg: #FFFFFF;
  --alert-box-border: #000000;

  --color-bg: #FFFFFF;
  --color-text: #1a1a1a;          /* Near-black — 15.3:1 contrast on white. WCAG AAA */
  --color-muted: #595959;         /* Replaces #888 gray — 7:1 on white. WCAG AA */
  --color-primary: #005fa3;       /* Slightly darker blue — 4.6:1 on white */
  --color-primary-dark: #004b82;

  /* WCAG AA compliant font scale — increased for seniors/low vision */
  --font-base: 1.2rem;            /* Was 1.1rem — minimum recommended for low vision */
  --font-large: 1.4rem;           /* Was 1.3rem */
  --font-xlarge: 2rem;            /* Was 1.8rem */
  --font-hero: 2.8rem;            /* Was 2.5rem */

  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  --border-radius: 4px;
  --border-width: 2px;
  --color-accent: #FFCC00;
  --color-focus: #005fa3;         /* Strong visible focus colour */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.15);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --transition: all 0.2s ease-in-out;
}


* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: var(--font-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-100%);
  background: var(--color-accent);
  color: var(--color-text);
  padding: var(--spacing-md);
  z-index: 9999;
  font-weight: bold;
  text-decoration: none;
  border: var(--border-width) solid var(--color-text);
  transition: transform 0.2s;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* === FOCUS STATES — WCAG 2.1 SC 2.4.7 & 2.4.11 ===
 * Visible on ALL interactive elements, not just keyboard.
 * 3px solid ring + 2px white halo = readable on any background.
 */
*:focus-visible {
  outline: 3px solid var(--color-focus) !important;
  outline-offset: 3px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--color-focus) !important;
  border-radius: 2px;
}

/* Remove default outline only when using mouse — keep for keyboard */
:focus:not(:focus-visible) {
  outline: none;
}

/* Typography */
h1, h2, h3 { color: var(--color-primary); margin-bottom: var(--spacing-md); font-weight: 800; }
h1 { font-size: var(--font-hero); line-height: 1.2; }
h2 { font-size: var(--font-xlarge); }
h3 { font-size: var(--font-large); }

a { color: var(--color-primary); text-decoration: underline; text-decoration-thickness: 2px; font-weight: bold; }
a:hover, a:focus { background-color: var(--color-accent); color: var(--color-text); text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--spacing-lg); }

/* Header */
header { background-color: #FFFFFF; border-bottom: 2px solid #EEEEEE; padding: 20px 0; transition: all 0.4s ease; }

/* Transparent Header for Home Page */
body.home-page header {
    background: transparent;
    border-bottom: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
}
body.home-page .main-nav {
    background: transparent;
    border: none;
    box-shadow: none;
}
body.home-page header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    z-index: 1002;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
body.home-page header.scrolled .logo a, 
body.home-page header.scrolled .tagline,
body.home-page header.scrolled .nav-links a {
    color: var(--logo-text);
}
body.home-page header.scrolled .main-nav {
    background: #FFFFFF;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.logo { display: flex; flex-direction: column; }
.logo a {
  color: var(--logo-text);
  text-decoration: none;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.tagline { 
  font-size: 1rem; 
  color: var(--logo-text); 
  font-weight: normal; 
  margin-top: 5px; 
}

.search-form {
  display: flex;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  overflow: hidden;
  max-width: 500px;
  flex-grow: 1;
  transition: var(--transition);
}
.search-form:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 95, 163, 0.1);
  background: #fff;
}
.search-form input {
  padding: 12px 20px;
  border: none;
  background: transparent;
  flex-grow: 1;
  font-size: 1rem;
  color: var(--color-text);
}
.search-form button {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 10px 25px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.search-form button:hover { background-color: var(--color-primary-dark); }

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-wishlist-header, .btn-cart-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-text);
  border: none;
  padding: 8px;
  position: relative;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 60px;
  transition: var(--transition);
}

body.home-page header:not(.scrolled) .btn-wishlist-header,
body.home-page header:not(.scrolled) .btn-cart-header {
  color: #fff;
}

.btn-wishlist-header:hover, .btn-cart-header:hover {
  background: rgba(0,0,0,0.03);
  color: var(--color-primary);
  border-radius: 8px;
}

body.home-page header:not(.scrolled) .btn-wishlist-header:hover,
body.home-page header:not(.scrolled) .btn-cart-header:hover {
  background: rgba(255,255,255,0.1);
  color: var(--color-accent);
}

.btn-wishlist-header svg, .btn-cart-header svg {
  margin-bottom: 4px;
}

.cart-count-badge {
  position: absolute;
  top: 0;
  right: 10px;
  background: var(--color-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

body.home-page header:not(.scrolled) .cart-count-badge {
  background: var(--color-accent);
  color: #000;
  border-color: #000;
}

/* Navigation */
/* Navigation Overhaul */
.main-nav {
  background: #FFFFFF;
  padding: 0;
  border-top: 1px solid #EEEEEE;
  border-bottom: 2px solid #EEEEEE;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.nav-links { 
  display: flex; 
  flex-wrap: nowrap; 
  gap: 0; 
  justify-content: center;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links li {
  position: relative;
}

.nav-links a {
  color: #334155;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

body.home-page header:not(.scrolled) .nav-links a,
body.home-page header:not(.scrolled) .logo a,
body.home-page header:not(.scrolled) .tagline {
    color: #FFFFFF;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.nav-links a[aria-current="page"] {
  color: var(--color-primary);
}

.nav-links a[aria-current="page"]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
}

/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    min-height: 700px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 80px;
    overflow: hidden;
    padding-top: 120px; /* Offset for absolute header on desktop */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.hero-content {
    max-width: 800px;
    color: #FFFFFF;
}

.hero-overline {
    display: block;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--color-accent);
    font-size: 1rem;
    opacity: 0.9;
}

.hero-title {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1.05;
    margin-bottom: 30px;
    color: #fff;
    letter-spacing: -3px;
}

.text-accent-hero {
    color: var(--color-accent);
    display: inline-block;
}

.title-line {
    display: block;
}

.hero-subtitle {
    font-size: 1.4rem;
    line-height: 1.6;
    margin-bottom: 40px;
    opacity: 0.9;
    font-weight: 400;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

/* Animations */
.animate-1 { opacity: 0; animation: fadeInUp 0.8s ease-out forwards; }
.animate-2 { opacity: 0; animation: fadeInUp 0.8s ease-out 0.2s forwards; }
.animate-3 { opacity: 0; animation: fadeInUp 0.8s ease-out 0.4s forwards; }
.animate-4 { opacity: 0; animation: fadeInUp 0.8s ease-out 0.6s forwards; }
.animate-5 { opacity: 0; animation: fadeInUp 0.8s ease-out 0.8s forwards; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cart Badge Pulse Animation */
@keyframes cartPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.cart-count-badge.pulse {
  animation: cartPulse 0.3s ease-in-out;
}

/* --- Mobile Responsive Overlay & Hamburger --- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.hamburger-line {
    width: 30px;
    height: 3px;
    background: var(--color-text);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

body.home-page .hamburger-line {
    background: #FFFFFF;
}

body.home-page header.scrolled .hamburger-line {
    background: var(--color-text);
}

.hamburger-btn.is-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg);
}

.hamburger-btn.is-open .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.hamburger-btn.is-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg);
}

/* --- Mobile Media Queries (Under 768px) --- */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .header-top {
        gap: 15px;
    }

    .search-form {
        order: 3;
        width: 100%;
        max-width: none;
        margin-top: 10px;
    }

    .header-actions {
        gap: 10px;
    }

    .header-actions .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Mobile Navigation Drawer */
    .main-nav {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: #FFFFFF;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1001;
        padding-top: 80px;
        overflow-y: auto;
    }

    .main-nav.nav-open {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 20px;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #EEEEEE;
    }

    .nav-links a {
        padding: 15px 0;
        font-size: 1.1rem;
        width: 100%;
        justify-content: flex-start;
    }

    /* Grid Adjustments */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .hero-title {
        font-size: 2.22rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .product-detail-layout {
        grid-template-columns: 1fr;
    }

    .product-gallery-img {
        max-height: 300px;
    }

    .container {
        padding: 0 15px;
    }

    /* Fix Form Inputs Overflowing */
    input, textarea, select {
        max-width: 100%;
    }

    .form-group input, .form-group textarea {
        width: 100% !important;
    }

    /* Touch Targets for Buttons */
    .btn, button, .qty-btn, .remove-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

@media (max-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    #cart-total-display {
        font-size: 1.8rem;
    }
}

/* --- Buttons (Premium) --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
  font-size: 1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  gap: 10px;
  line-height: 1;
}

.btn-primary {
  background: var(--color-primary);
  color: white !important;
  box-shadow: 0 4px 15px rgba(0, 95, 163, 0.25);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 95, 163, 0.35);
}

.btn-accent {
  background: var(--color-accent);
  color: #1a1a1a !important;
  box-shadow: 0 4px 15px rgba(255, 204, 0, 0.25);
}

.btn-accent:hover {
  background: #ffdb4d;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 204, 0, 0.35);
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white !important;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
  transform: translateY(-2px);
}

.btn-massive {
  padding: 18px 45px;
  font-size: 1.15rem;
}
.about-content-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.about-section {
  margin-bottom: 60px;
}

.about-section h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: var(--spacing-lg);
  position: relative;
  display: inline-block;
}

.about-section h2::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

.about-text {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #475569;
}

.about-image-wrapper {
  margin-bottom: 40px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 4px solid white;
}

.about-image-wrapper img {
  width: 100%;
  display: block;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
  margin-top: var(--spacing-xl);
}

.value-card {
  background: white;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.value-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.value-icon {
  font-size: 2.5rem;
  margin-bottom: 15px;
  display: block;
}

.value-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--color-text);
}

.value-card p {
  font-size: 0.95rem;
  color: #64748B;
  line-height: 1.5;
}

.about-cta {
  background: var(--color-secondary);
  padding: 60px;
  border-radius: 30px;
  text-align: center;
  margin-top: 40px;
  border: 2px dashed var(--color-primary);
}

@media (max-width: 768px) {
  .features-grid { gap: 30px; }
  .categories-list { font-size: 1.25rem; }
  .footer-links { gap: 15px; flex-direction: column; align-items: center; }
}

/* --- Mobile Responsive Overlay & Hamburger --- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1002;
}

.hamburger-line {
    width: 30px;
    height: 3px;
    background: var(--color-text);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

body.home-page .hamburger-line {
    background: #FFFFFF;
}

body.home-page header.scrolled .hamburger-line {
    background: var(--color-text);
}

.hamburger-btn.is-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg);
}

.hamburger-btn.is-open .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.hamburger-btn.is-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg);
}

/* --- Mobile Media Queries (Under 768px) --- */
@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
    }

    .header-top {
        gap: 15px;
    }

    .search-form {
        order: 3;
        width: 100%;
        max-width: none;
        margin-top: 10px;
    }

    .header-actions {
        gap: 10px;
    }

    .header-actions .btn {
        padding: 8px 12px;
        font-size: 0.9rem;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Mobile Navigation Drawer */
    .main-nav {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: #FFFFFF;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1001;
        padding-top: 80px;
        overflow-y: auto;
    }

    .main-nav.nav-open {
        transform: translateX(0);
    }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 20px;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #EEEEEE;
    }

    .nav-links a {
        padding: 15px 0;
        font-size: 1.1rem;
        width: 100%;
        justify-content: flex-start;
    }

    /* Grid Adjustments */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .hero-title {
        font-size: 2.22rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .product-detail-layout {
        grid-template-columns: 1fr;
    }

    .product-gallery-img {
        max-height: 300px;
    }

    .container {
        padding: 0 15px;
    }

    /* Fix Form Inputs Overflowing */
    input, textarea, select {
        max-width: 100%;
    }

    .form-group input, .form-group textarea {
        width: 100% !important;
    }

    /* Touch Targets for Buttons */
    .btn, button, .qty-btn, .remove-btn {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Extra Small Devices (Under 480px) */

/* --- Checkout Layout --- */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: var(--spacing-xl);
    align-items: start;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-md);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--color-text);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #E2E8F0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

@media (max-width: 992px) {
    .checkout-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    #cart-total-display {
        font-size: 1.8rem;
    }
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--color-primary);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--color-accent);
    color: var(--color-text);
    transform: translateY(-5px);
}
