:root {
    /* Color Palette */
    --bg: #FDFAF5;
    --bg-card: #FFFFFF;
    --accent: #B5541A;
    --accent-light: #F4E4D4;
    --text-dark: #2C1A0E;
    --text-mid: #5C4033;
    --text-light: #9C7B6B;
    --border: #E8D8C8;
    --success: #4A7C59;
    --radius: 16px;
    --shadow: 0 4px 12px rgba(181, 84, 26, 0.08);
}

/* =========================================
   Page Transition Overlay
   ========================================= */
@keyframes transitionFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes transitionFadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.page-transition-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    /* Fade OUT on page entry (covers the flash of the previous page) */
    animation: transitionFadeOut 0.35s ease-out forwards;
}

.page-transition-overlay.active {
    pointer-events: all;
    opacity: 0;
    /* Fade IN when leaving page */
    animation: transitionFadeIn 0.3s ease-in forwards;
}



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

body {
    background-color: var(--bg);
    color: var(--text-mid);
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    /* Center the main content card */
}

/* Typography Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-dark);
}

.font-playfair {
    font-family: 'Playfair Display', serif;
}

.font-dm {
    font-family: 'DM Serif Display', serif;
}

.font-roboto {
    font-family: 'Roboto', sans-serif;
}

.font-inter {
    font-family: 'Inter', sans-serif;
}

.font-dancing {
    font-family: 'Dancing Script', cursive;
}

.text-accent {
    color: var(--accent);
}

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

/* Layout Container */
.container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    background-color: transparent;
}

/* Animation Keyframes */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scalePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.06);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Utility Animations */
.animate-fade-up {
    opacity: 0;
    /* JS handles adding the animation class or we set it here but need standard delay */
    animation: fadeUp 0.4s ease-out forwards;
}

/* Stagger delays with CSS variables if possible, or utility classes */
.delay-1 {
    animation-delay: 0.05s;
}

.delay-2 {
    animation-delay: 0.1s;
}

/* Skeleton Loader */
.skeleton {
    background: #e0e0e0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    display: inline-block;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.animate-pulse {
    animation: scalePulse 0.3s ease-in-out;
}

.animate-shake {
    animation: shake 0.4s ease-in-out;
}


/* Components */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius);
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: white;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-dark);
    resize: none;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* Stepper Component */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 16px 0;
}

.stepper-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Make them circular for touch targets */
    border: 2px solid var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.stepper-btn:active {
    transform: scale(0.9);
}

.stepper-val {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--text-dark);
    min-width: 40px;
    text-align: center;
}

/* Steps list */
.step-card {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    align-items: flex-start;
}

.step-num {
    background: var(--accent);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Decorative Divider */
hr.divider {
    border: 0;
    height: 1px;
    background: var(--accent);
    opacity: 0.2;
    margin: 32px 0;
}

/* Specific Page Styles */
/* Hero Section */
.hero-img {
    width: 100%;
    aspect-ratio: 1/1;
    /* Square or 4:3? Request says "Full-width". Let's stick to square or slightly tall for mobile. */
    object-fit: cover;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    margin-left: -24px;
    /* Counteract container padding if we used padding on container, but we reset. */
    /* Implementation detailed logic: The container logic is just max-width.
       On mobile we might want edge-to-edge image.
       Let's just make it 100% width of the container.
    */
    width: calc(100% + 48px);
    /* Negative margin hack to go full bleed inside a padded card?
    Wait, the design says "Full-width product image".
    If we are inside a .container, and if we want it to look like a card,
    maybe the main content is inside a 'card' or just the body is the container.
    Let's simple it out: Image is top of page.
    */
    margin: -20px -20px 24px -20px;
    /* Pull to edges of body padding on mobile? No, body has padding. */
    width: calc(100% + 40px);
}

/* --- Carousel Styles --- */
.carousel-wrapper {
    position: relative;
    width: calc(100% + 40px);
    margin: -20px -20px 24px -20px;
    overflow: hidden;
}

.carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    min-width: 100%;
    /* Same height/aspect as hero-img for consistency */
    aspect-ratio: 1/1;
    object-fit: cover;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    /* KEY FIX: Force stop at every slide */
}

/* Navigation Controls (Below Image) */
.carousel-controls {
    display: none;
    /* Hidden on mobile by default */
    justify-content: center;
    gap: 24px;
    margin-top: -8px;
    /* Pull closer to image */
    margin-bottom: 24px;
}

@media (min-width: 500px) {
    .carousel-controls {
        display: flex;
        /* Show only on Desktop/Tablet */
    }
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--border);
    /* Softer border */
    color: var(--text-dark);

    /* No absolute positioning */
    position: static;
    transform: none;

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    /* Larger icon */
    line-height: 1;
    padding-bottom: 2px;
    /* Visual optical adjustment for the arrow char */

    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.carousel-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(181, 84, 26, 0.25);
}

/* Remove old specific positioning if any remains */
.carousel-btn.prev,
.carousel-btn.next {
    left: auto;
    right: auto;
    top: auto;
}

.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
    pointer-events: none;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.indicator.active {
    background: white;
    transform: scale(1.2);
    opacity: 1;
}

@media (min-width: 500px) {
    .carousel-wrapper {
        width: 100%;
        margin: 0 0 24px 0;
        border-radius: var(--radius);
    }

    .carousel-slide {
        border-radius: var(--radius);
    }
}

/* =========================================
   Variant Selector (Chips)
   ========================================= */
.variant-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.variant-chip {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg-card);
    color: var(--text-mid);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variant-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.variant-chip.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(181, 84, 26, 0.2);
}

/* =========================================
   Site Header (inside container)
   ========================================= */
.site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px 0 18px;
    margin-bottom: 24px;
    border-bottom: 1px dashed var(--border);
}

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.1;
}

.brand-subtitle {
    font-family: 'DM Serif Display', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--accent);
    line-height: 1.1;
}

/* =========================================
   Cart FAB (Floating Action Button)
   ========================================= */
.cart-fab {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1000;
    background: var(--accent);
    color: white;
    border-radius: 50px;
    padding: 9px 16px 9px 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(181, 84, 26, 0.35);
    opacity: 0;
    transform: translateY(-12px) scale(0.9);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.cart-fab.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.cart-fab:active {
    transform: scale(0.95);
}

.cart-fab-icon {
    font-size: 1rem;
    line-height: 1;
}

/* =========================================
   Cart Item Row (cart.html)
   ========================================= */
.cart-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-img {
    width: 68px;
    height: 68px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--bg);
}

.cart-item-img-placeholder {
    width: 68px;
    height: 68px;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-dark);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-variant {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.cart-item-stepper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-stepper-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.cart-item-stepper-btn:active {
    background: var(--accent);
    color: white;
}

.cart-item-qty {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    min-width: 20px;
    text-align: center;
}

.cart-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.cart-item-price {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 2px 4px;
    line-height: 1;
    transition: color 0.15s;
}

.cart-item-remove:hover {
    color: #c0392b;
}

/* =========================================
   Cart Summary / Total Bar
   ========================================= */
.cart-total-bar {
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.cart-total-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-mid);
}

.cart-total-amount {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--accent);
}

/* =========================================
   Toast Notification
   ========================================= */
.cart-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-dark);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 11px 20px;
    border-radius: 50px;
    white-space: nowrap;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.cart-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =========================================
   Empty Cart State
   ========================================= */
.cart-empty {
    text-align: center;
    padding: 48px 0;
}

.cart-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: block;
}