/* ========================================
   Demo Shop — Main Styles
   ======================================== */

@import 'variables.css';

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

html { scroll-behavior: smooth; }

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

body.theme-dark {
    --shop-border: #334155;
    --shop-muted: #64748b;
    --shop-surface: #1e293b;
}

.container {
    max-width: var(--shop-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3, h4 { font-family: var(--shop-heading-font); font-weight: 700; line-height: 1.2; }
a { color: var(--shop-primary); text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── Announcement Bar ── */
.announcement-bar {
    background: var(--shop-text);
    color: var(--shop-bg);
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 1001;
    position: relative;
}

/* ── Navbar ── */
.navbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition: background var(--shop-transition), box-shadow var(--shop-transition), padding var(--shop-transition);
    padding: 1.5rem 0;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shop-shadow);
    padding: 0.8rem 0;
}

body.theme-dark .navbar.scrolled {
    background: rgba(30, 41, 59, 0.95);
}

.nav-container {
    max-width: var(--shop-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr minmax(0, auto) 1fr;
    align-items: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: var(--shop-text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color var(--shop-transition), opacity var(--shop-transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--shop-primary);
    transition: width var(--shop-transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

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

.nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.nav-logo img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.nav-logo span {
    font-family: var(--shop-heading-font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--shop-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
}

.icon-link {
    color: var(--shop-text);
    position: relative;
    display: flex;
    align-items: center;
    transition: color var(--shop-transition), transform var(--shop-transition);
}

.icon-link:hover {
    color: var(--shop-primary);
    transform: translateY(-2px);
}

.cart-icon {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--shop-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    width: max-content;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--shop-text);
    transition: all var(--shop-transition);
}


.menu-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.menu-backdrop.open { display: block; }

/* ── Enhanced Hero ── */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 8rem 1.5rem 4rem;
    background: var(--shop-bg);
    overflow: hidden;
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    filter: blur(100px);
    opacity: 0.15;
    border-radius: 50%;
    z-index: 0;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--shop-primary);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--shop-text);
    bottom: 50px;
    left: -150px;
}

.hero-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-content {
    max-width: 600px;
    text-align: left;
}

.hero-badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--shop-surface);
    border: 1px solid var(--shop-border);
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--shop-primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    margin-bottom: 1.5rem;
    color: var(--shop-text);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.2rem;
    color: var(--shop-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.05rem;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--shop-border);
}

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

.stat-num {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--shop-heading-font);
    color: var(--shop-text);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--shop-muted);
    font-weight: 500;
}

.hero-visual {
    position: relative;
}

.hero-image-wrapper {
    position: relative;
    border-radius: var(--shop-radius-lg, 24px);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    aspect-ratio: 4/5;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.hero-image-wrapper:hover .hero-img {
    transform: scale(1.05);
}

@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    .hero-content {
        max-width: 100%;
        text-align: center;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-stats {
        justify-content: center;
    }
    .hero-image-wrapper {
        aspect-ratio: 16/9;
        max-height: 500px;
    }
}


.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--shop-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all var(--shop-transition);
    text-decoration: none;
}

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

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

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

.btn-outline:hover { background: var(--shop-primary-light); }

/* ── Sections ── */
.section {
    padding: 5rem 1.5rem;
    max-width: var(--shop-max-width);
    margin: 0 auto;
}

.section-alt {
    background: var(--shop-surface);
    max-width: none;
}

.section-alt > .container {
    max-width: var(--shop-max-width);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 2rem;
}

.section-header p {
    color: var(--shop-muted);
    font-size: 1.05rem;
}

/* ── Product Grid ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ── Team Section ── */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* ── Contact Section ── */
.contact-section {
    background: var(--shop-surface);
    border-radius: var(--shop-radius);
    padding: 3rem;
    text-align: center;
}

.contact-methods {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.contact-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.contact-method svg { width: 32px; height: 32px; stroke: var(--shop-primary); }
.contact-method span { font-weight: 500; }
.contact-method a { color: var(--shop-primary); font-weight: 600; }

/* ── Footer ── */
.footer {
    position: relative;
    background:
        radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--shop-primary) 10%, transparent) 0%, transparent 42%),
        radial-gradient(circle at 88% 82%, color-mix(in srgb, var(--shop-primary) 8%, transparent) 0%, transparent 45%),
        linear-gradient(180deg, color-mix(in srgb, var(--shop-surface) 85%, var(--shop-bg) 15%) 0%, var(--shop-surface) 100%);
    border-top: 1px solid color-mix(in srgb, var(--shop-primary) 14%, var(--shop-border));
    padding: 3.5rem 1.5rem 1.25rem;
    color: var(--shop-muted);
    font-size: 0.9rem;
}

.footer a {
    color: color-mix(in srgb, var(--shop-primary) 76%, var(--shop-text));
    text-decoration: none;
    transition: color var(--shop-transition), transform var(--shop-transition);
}

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

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.footer-top {
    display: grid;
    grid-template-columns: minmax(280px, 1.3fr) repeat(2, minmax(170px, 0.8fr));
    gap: 2rem;
    align-items: start;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 38ch;
}

.footer-brand-name {
    font-family: var(--shop-heading-font);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 0.01em;
    color: var(--shop-text);
}

.footer-brand-text {
    font-size: 0.95rem;
    line-height: 1.65;
    color: color-mix(in srgb, var(--shop-muted) 78%, var(--shop-text));
}

.footer-column h4 {
    font-family: var(--shop-heading-font);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--shop-text);
    margin-bottom: 0.9rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-links a {
    display: inline-block;
    font-weight: 500;
    color: color-mix(in srgb, var(--shop-muted) 72%, var(--shop-text));
}

.footer-links a:hover {
    color: var(--shop-primary);
    transform: translateX(2px);
}

.footer-bottom {
    border-top: 1px solid var(--shop-border);
    padding-top: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-copy {
    font-size: 0.85rem;
    color: color-mix(in srgb, var(--shop-muted) 82%, var(--shop-text));
}

.footer-credit {
    font-size: 0.82rem;
    color: color-mix(in srgb, var(--shop-muted) 80%, var(--shop-text));
}

.footer-credit a {
    font-weight: 700;
    color: var(--shop-primary);
}

.footer-credit a:hover {
    color: color-mix(in srgb, var(--shop-primary) 80%, var(--shop-text));
}

.footer-legal-links {
    display: flex;
    gap: 1rem;
}

.footer-legal-links a {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Page Header (for inner pages) ── */
.page-header {
    padding: 1rem 1.5rem;
    text-align: center;
    background: var(--shop-surface);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0;
}

/* ── Shared Element Container ── */
.shared-element-container {
    max-width: var(--shop-max-width);
    margin: 0 auto;
    padding: 1rem 0 4rem;
}

/* ── Loading ── */
.loading-spinner {
    display: flex;
    justify-content: center;
    padding: 4rem;
}

.loading-spinner::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--shop-border);
    border-top-color: var(--shop-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.page-loading {
    display: flex;
    justify-content: center;
    padding: 4rem;
}

.page-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--shop-border);
    border-top-color: var(--shop-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ── */
@media (max-width: 900px) {
    .nav-container { grid-template-columns: 1fr minmax(0, auto) 1fr; }
    
    .mobile-menu-toggle { 
        display: flex; 
        justify-self: flex-start;
        align-self: center; 
        position: relative;
        z-index: 1002;
    }
    
    .mobile-menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .mobile-menu-toggle.open span:nth-child(2) { opacity: 0; }
    .mobile-menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .hide-mobile { display: none !important; }

    .nav-cta { display: none; }

    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 85vw;
        height: 100dvh;
        background: var(--shop-surface);
        flex-direction: column;
        align-items: flex-start;
        padding: 7rem 2.5rem 3rem;
        gap: 1.5rem;
        transform: translateX(-100%);
        transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
        z-index: 1001;
    }

    .nav-menu.open {
        transform: translateX(0);
        box-shadow: 15px 0 50px rgba(0,0,0,0.08);
    }

    body.theme-dark .nav-menu.open {
        box-shadow: 15px 0 50px rgba(0,0,0,0.4);
    }

    .nav-link { 
        font-family: var(--shop-heading-font);
        font-size: 2.25rem;
        font-weight: 500;
        letter-spacing: -0.02em;
        padding: 0; 
        color: var(--shop-text);
        width: 100%; 
        display: block;
        opacity: 0.6;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
    
    .nav-link::after {
        display: none !important;
    }

    .nav-link:hover, .nav-link.active {
        opacity: 1;
        color: var(--shop-text);
        background: transparent;
        transform: translateX(10px);
    }

    .hero { min-height: 100svh; padding: 2.5rem 1.5rem 4rem; text-align: center; }
    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .hero h1 { font-size: 2.5rem; line-height: 1.18; margin-bottom: 1rem; }
    .hero p { font-size: 1.1rem; max-width: 100%; margin-bottom: 2rem; }

    .section { padding: 4rem 1.25rem; }
    .section-title { font-size: 1.75rem; margin-bottom: 2rem; text-align: center; }

    .page-header { padding: 1rem 1.5rem; }

    .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
    .contact-info { padding-right: 0; border-right: none; border-bottom: 1px solid rgba(0,0,0,0.1); padding-bottom: 2rem; }
    .contact-methods { flex-direction: column; align-items: stretch; gap: 1rem; }
    .contact-method { display: flex; align-items: center; justify-content: flex-start; padding: 1.25rem; background: var(--shop-surface); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
    .contact-form { padding-top: 1rem; }
    
    .footer {
        padding-top: 2.8rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        text-align: center;
    }

    .footer-brand {
        align-items: center;
        max-width: 100%;
    }

    .footer-links {
        align-items: center;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-logo h1 { font-size: 1.25rem; }
    .hero h1 { font-size: 2.1rem; }
    .hero-actions { flex-direction: column; width: 100%; gap: 1rem; }
    .btn { width: 100%; justify-content: center; padding: 1rem 1.5rem; font-size: 1.05rem; }
    
    .section { padding: 3rem 1rem; }
}

/* ── Section Upgrades ── */
.section {
    padding: 7rem 1.5rem;
}

@media (max-width: 900px) { .section { padding: 4rem 1.25rem; } }
@media (max-width: 480px) { .section { padding: 3rem 1rem; } }

/* ── Navbar Upgrade ── */
.navbar {
    padding: 1.5rem 0;
    backdrop-filter: blur(10px);
}
.navbar.scrolled {
    padding: 0.8rem 0;
    background: rgba(255, 255, 255, 0.9);
}
body.theme-dark .navbar.scrolled {
    background: rgba(30, 41, 59, 0.9);
}

/* Keep nav in normal flow to avoid cutting into content under it */
.announcement-bar {
    position: relative;
    z-index: 1002;
}

.navbar {
    position: sticky;
    top: 0;
    width: 100%;
}

.navbar.scrolled {
    position: sticky;
    top: 0;
}

/* ── Specific Overrides ── */
section.section-products {
    padding-top: 0;
    padding-bottom: 5rem;
}

/* ── Shared Element CSS Variable Mapping ── */
/* Map demo-shop theme vars → shared element var names */
.shared-element-container {
    --color-primary: var(--shop-primary);
    --color-black: var(--shop-text);
    --color-white: var(--shop-bg);
    --color-gray: var(--shop-muted);
    --color-gray-lighter: var(--shop-border);
    --color-off-white: var(--shop-surface);
    --font-family-base: var(--shop-body-font);
    --font-family-heading: var(--shop-heading-font);
}

/* ── Product Detail — Reduce top padding ── */
section.section:has(.shared-element-container #detailContainer) {
    padding-top: 2rem;
}

/* ── Demo Shop: Scribbled Double Underline on Section Titles ── */
/* Applied to section headers in the demo shop pages and shared elements */

/* Section titles in the product detail shared element */
.shared-element-container .section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
    margin-bottom: 1.75rem;
}

/* Accent color scribbled underline via SVG mask */
.shared-element-container .section-title::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--shop-primary);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 2c10-1.8 15 2.2 22 0.5s14-2 22-0.2s10 0.8 14-0.3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M1 4.8c10-1.8 15 2.2 22 0.5s14-2 22-0.2s10 0.8 14-0.3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 2c10-1.8 15 2.2 22 0.5s14-2 22-0.2s10 0.8 14-0.3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M1 4.8c10-1.8 15 2.2 22 0.5s14-2 22-0.2s10 0.8 14-0.3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
    z-index: 1;
}

/* Also apply to demo-shop's own section headers */
.section-header h2,
.page-header h1 {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-header h2::before,
.page-header h1::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 6px;
    background: var(--shop-primary);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 2c10-1.8 15 2.2 22 0.5s14-2 22-0.2s10 0.8 14-0.3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M1 4.8c10-1.8 15 2.2 22 0.5s14-2 22-0.2s10 0.8 14-0.3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 6' preserveAspectRatio='none'%3E%3Cpath d='M1 2c10-1.8 15 2.2 22 0.5s14-2 22-0.2s10 0.8 14-0.3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M1 4.8c10-1.8 15 2.2 22 0.5s14-2 22-0.2s10 0.8 14-0.3' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat;
    mask-size: 100% 100%;
    -webkit-mask-size: 100% 100%;
}

/* Shared element section titles — left aligned */
.shared-element-container .section-title::before {
    left: 0;
    transform: none;
}
