/* Color palette derived from the Salvina Flowers theme */
:root {
    --bg-main: #d8c397;
    /* Warm Gold/Beige */
    --text-dark: #2b261f;
    /* Dark Espresso */
    --text-muted: #6e614d;
    /* Subtle Secondary Text */
    --btn-bg: #2e2821;
    /* Dark Accent for Buttons */
    --btn-text: #d8c397;
    /* Gold Button Text */
    --dropdown-bg: #211c17;
    /* Dark Overlay Background */
    --border-subtle: rgba(43, 38, 31, 0.12);
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Montserrat', sans-serif;
}

/* Global Reset & Unselectable Text Rule */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: var(--font-serif);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
}

/* Navigation Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 5%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.8rem;
}

.brand-logo {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s;
}

.brand-logo:hover {
    opacity: 0.7;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 3rem;
}

/* Navigation Links */
.nav-center a,
.dropdown-btn {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.nav-center a:hover,
.dropdown-btn:hover {
    opacity: 0.6;
}

.mobile-cart-link {
    display: none;
}

/* Desktop Dropdown Styling */
.dropdown {
    position: relative;
    display: inline-block;
}

.arrow {
    font-size: 0.8rem;
    margin-left: 4px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.dropdown.open .arrow,
.dropdown:hover .arrow {
    transform: rotate(180deg);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dropdown-bg);
    min-width: 180px;
    padding: 0.8rem 0;
    box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.2);
    margin-top: 10px;
    border-radius: 2px;
}

.dropdown-content::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

.dropdown-content a {
    color: var(--bg-main);
    padding: 0.7rem 1.4rem;
    display: block;
    font-size: 1.1rem;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: #352d25;
    opacity: 1;
}

@media (min-width: 901px) {
    .dropdown:hover .dropdown-content {
        display: block;
    }
}

/* Desktop Cart Icon */
.nav-right .cart-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dark);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.nav-right .cart-btn:hover {
    opacity: 0.6;
}

.cart-icon {
    display: block;
}

.cart-count {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Mobile Hamburger Icon */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
}

.mobile-toggle span {
    width: 26px;
    height: 2px;
    background-color: var(--text-dark);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Background Dim Overlay */
.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s ease;
    z-index: 98;
}

.menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Hero Section Layout (Index Page) */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 0 1rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-size: 4rem;
    font-weight: 500;
    color: var(--text-dark);
    letter-spacing: 2px;
    margin-bottom: 0.6rem;
    line-height: 1.1;
    animation: fadeInUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-subtitle {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 6px;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    text-transform: uppercase;
}

.hero-btn {
    display: inline-block;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    padding: 1.1rem 3.2rem;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.hero-btn:hover {
    background-color: #423b32;
    transform: translateY(-2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(35px);
    }

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

/* Mobile Header Navigation Override */
@media (max-width: 900px) {
    .navbar {
        padding: 1.6rem 6%;
    }

    .nav-right {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .nav-center {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background-color: #bfa87a;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 6.5rem 2.2rem 3.5rem;
        gap: 0;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 99;
    }

    .nav-center.active {
        right: 0;
    }

    .nav-center a,
    .dropdown-btn {
        width: 100%;
        text-align: left;
        padding: 1.1rem 0;
        font-size: 1.4rem;
        border-bottom: 1px solid var(--border-subtle);
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-btn {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .dropdown-content {
        position: static;
        transform: none;
        background-color: transparent;
        box-shadow: none;
        min-width: 100%;
        margin-top: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out, padding 0.3s ease;
    }

    .dropdown-content::before {
        display: none;
    }

    .dropdown.open .dropdown-content {
        display: block;
        max-height: 250px;
        padding: 0.4rem 0 0.8rem 1rem;
        border-bottom: 1px solid var(--border-subtle);
    }

    .dropdown-content a {
        padding: 0.6rem 0;
        font-size: 1.15rem;
        color: var(--text-dark);
        border-bottom: none;
        opacity: 0.85;
    }

    .mobile-cart-link {
        display: flex;
        align-items: center;
        gap: 10px;
        font-family: var(--font-serif);
        font-size: 1.4rem;
        font-weight: 500;
        color: var(--text-dark);
        text-decoration: none;
        width: 100%;
        padding: 1.1rem 0;
        border-bottom: 1px solid var(--border-subtle);
    }

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

/* ==========================================================================
   Full-Screen Editorial Shop Overlay Menu
   ========================================================================== */

.shop-overlay {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100vw;
    height: 100vh;
    background-color: #f7f3eb;
    z-index: 9999;
    transition: left 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

.shop-overlay.active {
    left: 0;
}

.shop-close-btn {
    position: absolute;
    top: 2.2rem;
    left: 4.5rem;
    background: none;
    border: none;
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-dark);
    cursor: pointer;
    z-index: 10;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.shop-close-btn:hover {
    transform: rotate(90deg);
    opacity: 0.6;
}

.shop-overlay-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.3fr;
    height: 100vh;
    width: 100%;
}

/* Column 1: Main Categories */
.shop-col-main {
    padding: 7.5rem 4.5rem 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #f7f3eb;
}

.shop-categories-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.shop-cat-item {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 400;
    color: var(--text-dark);
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    transition: color 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: inline-block;
    width: fit-content;
}

.shop-cat-item::before {
    content: '— ';
    opacity: 0;
    margin-right: 0;
    transition: opacity 0.4s ease, margin-right 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.shop-cat-item.active,
.shop-cat-item:hover {
    color: #a48248;
    transform: translateX(8px);
}

.shop-cat-item.active::before,
.shop-cat-item:hover::before {
    opacity: 1;
    margin-right: 8px;
}

.shop-cat-item.highlight {
    color: #8c6e3d;
}

.shop-col-footer {
    display: flex;
    gap: 2.2rem;
    border-top: 1px solid var(--border-subtle);
    padding-top: 2rem;
    margin-top: auto;
}

.shop-col-footer a {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.4s ease;
}

.shop-col-footer a:hover {
    color: var(--text-dark);
}

/* Column 2: Dark Sub-categories Panel */
.shop-col-sub {
    background-color: var(--dropdown-bg);
    color: var(--bg-main);
    padding: 7.5rem 3.5rem 3.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
}

.sub-panel {
    display: none;
}

.sub-panel.active {
    display: block;
    animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sub-panel-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    color: var(--bg-main);
    margin-bottom: 2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(216, 195, 151, 0.2);
}

.sub-category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.sub-category-list a {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: #d1c5b4;
    text-decoration: none;
    transition: color 0.4s ease, padding-left 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.sub-category-list a:hover {
    color: var(--bg-main);
    padding-left: 6px;
}

/* Column 3: High-end Editorial Image */
.shop-col-image {
    background-image: url('https://images.unsplash.com/photo-1526047932273-341f2a7631f9?q=80&w=1200&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    position: relative;
}

.shop-col-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(43, 38, 31, 0.15);
}

/* Keyframe Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

/* Responsive Overrides for Shop Overlay */
@media (max-width: 1024px) {
    .shop-overlay-grid {
        grid-template-columns: 1.2fr 1fr;
    }

    .shop-col-image {
        display: none;
    }

    .shop-col-main {
        padding: 6.5rem 2.5rem 3rem;
    }

    .shop-col-sub {
        padding: 6.5rem 2.5rem 3rem;
    }

    .shop-close-btn {
        left: 2.5rem;
    }

    .shop-cat-item {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .shop-overlay {
        overflow-y: auto;
    }

    .shop-close-btn {
        top: 1.8rem;
        left: 2rem;
    }

    .shop-overlay-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .shop-col-main {
        padding: 5.5rem 2rem 2.5rem;
    }

    .shop-cat-item {
        font-size: 1.7rem;
    }

    .shop-col-sub {
        padding: 2.5rem 2rem 3.5rem;
    }

    .shop-col-footer {
        flex-wrap: wrap;
        gap: 1rem;
        padding-top: 1.5rem;
    }
}


/* ==========================================================================
   Cart Page Layout & Empty Cart Styling
   ========================================================================== */

.cart-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    padding: 10rem 8% 5rem;
    min-height: 80vh;
}

.cart-container {
    max-width: 800px;
    width: 100%;
}

.cart-title {
    font-family: var(--font-serif);
    font-size: 3.2rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

.cart-empty-text {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 2.8rem;
    opacity: 0.85;
}

.continue-btn {
    display: inline-block;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    padding: 1.1rem 2.8rem;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.continue-btn:hover {
    background-color: #423b32;
    transform: translateY(-2px);
}

@media (max-width: 900px) {
    .cart-page {
        padding-top: 7.5rem;
        padding-left: 6%;
        padding-right: 6%;
    }

    .cart-title {
        font-size: 2.5rem;
    }

    .cart-empty-text {
        font-size: 1.15rem;
    }
}

/* ==========================================================================
   Active Cart Page & Item Table Styling
   ========================================================================== */

.cart-items-list {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
}

.cart-item-row {
    display: grid;
    grid-template-columns: 100px 1fr 120px 120px;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.cart-item-img img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    display: block;
}

.cart-item-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 0.3rem;
}

.cart-item-meta {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-bottom: 0.4rem;
}

.cart-item-edit {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.8rem;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.7;
}

/* Quantity controls */
.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.qty-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 0.4rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.qty-btn:hover {
    opacity: 1;
}

.qty-num {
    font-size: 0.95rem;
    min-width: 15px;
    text-align: center;
}

/* Price & Remove Column */
.cart-item-price-col {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
}

.cart-item-price {
    font-size: 0.95rem;
}

.remove-btn {
    background: none;
    border: none;
    color: inherit;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.remove-btn:hover {
    opacity: 1;
}

/* Summary Bar */
.cart-summary {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.subtotal-row {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-bottom: 2.5rem;
}

.subtotal-label {
    font-size: 0.9rem;
    opacity: 0.7;
}

.subtotal-amount {
    font-size: 1.1rem;
    font-weight: 500;
}

.checkout-btn {
    width: 380px;
    max-width: 100%;
    padding: 1.2rem;
    background-color: #31363f;
    color: #ffffff;
    border: none;
    letter-spacing: 2px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.checkout-btn:hover {
    background-color: #424854;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .cart-item-row {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        row-gap: 1rem;
    }

    .cart-item-qty {
        grid-column: 2;
    }

    .cart-item-price-col {
        grid-column: 2;
        justify-content: space-between;
    }

    .checkout-btn {
        width: 100%;
    }
}

/* Cart Page Enhanced Visual Styling */
.cart-section {
    background-color: #f9f6f0;
    padding: 60px 0;
    min-height: 70vh;
    color: #2c2c2c;
}

.cart-wrapper {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Items Container Box */
#cart-items-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #eae2d6;
}

/* Individual Cart Row */
.cart-item {
    display: grid;
    grid-template-columns: 80px 2fr 120px 100px 40px;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f0e6d9;
}

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

.cart-item-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.cart-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
}

.cart-item-price {
    color: #766e65;
    font-size: 0.95rem;
    margin: 0;
}

/* Quantity Control Buttons */
.cart-item-qty {
    display: flex;
    align-items: center;
    background: #f4efe6;
    border-radius: 6px;
    padding: 4px 8px;
    width: fit-content;
}

.qty-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: bold;
    color: #4a3b32;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    border-radius: 4px;
}

.qty-btn:hover {
    background: #e2d7c7;
}

.qty-value {
    padding: 0 10px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Line Total & Remove Button */
.cart-item-total {
    font-weight: 700;
    font-size: 1.05rem;
    color: #1a1a1a;
    text-align: right;
}

.cart-item-remove {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #a39688;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s;
}

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

/* Order Summary Box */
.cart-summary {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    height: fit-content;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #eae2d6;
}

.cart-summary h3 {
    margin-top: 0;
    font-size: 1.3rem;
    border-bottom: 2px solid #f4efe6;
    padding-bottom: 12px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin: 16px 0;
    font-size: 1rem;
    color: #4a4a4a;
}

.summary-row.total {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1a1a1a;
    border-top: 1px solid #f4efe6;
    padding-top: 16px;
}

.btn-checkout {
    display: block;
    width: 100%;
    background-color: #2c3e50;
    color: #ffffff;
    text-align: center;
    padding: 14px 0;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 20px;
    transition: background 0.2s;
}

.btn-checkout:hover {
    background-color: #1a252f;
}

/* Responsive adjustments */
/* @media (max-width: 768px) {
    .cart-wrapper {
        grid-template-columns: 1fr;
    }
    
    .cart-item {
        grid-template-columns: 60px 1fr 100px auto;
        grid-template-areas: 
            "img details details remove"
            "img qty total remove";
    }
} */

/* ==========================================================================
   Mobile Cart Layout (640px & below) — Matches Exact Mockup
   ========================================================================== */

/* ==========================================================================
   Mobile Layout (640px & below) — Stacked Card & 2-Row Item Design
   ========================================================================== */

@media (max-width: 768px) {

    /* 1. Stack main layout so summary block drops down below items */
    .cart-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* 2. Transform items into the 2-row layout */
    .cart-item-row,
    .cart-item {
        display: grid;
        grid-template-columns: clamp(60px, 18vw, 80px) 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "img info remove"
            "img qty  price";
        gap: clamp(8px, 2vw, 12px) clamp(10px, 3vw, 18px);
        align-items: center;
        padding: 1.2rem 0;
    }

    /* Explicit Grid Area Bindings */
    .cart-item-img,
    .cart-item-image {
        grid-area: img;
        align-self: start;
    }

    .cart-item-img img,
    .cart-item-image img {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 4px;
        display: block;
    }

    .cart-item-info {
        grid-area: info;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .cart-item-title {
        font-size: clamp(0.95rem, 3.8vw, 1.15rem);
        line-height: 1.25;
    }

    .cart-item-meta {
        font-size: clamp(0.75rem, 2.8vw, 0.85rem);
        opacity: 0.75;
    }

    .cart-item-edit {
        font-size: 0.8rem;
        text-decoration: underline;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        width: fit-content;
        margin-top: 2px;
    }

    .remove-btn,
    .cart-item-remove {
        grid-area: remove;
        justify-self: end;
        align-self: start;
        background: none;
        border: none;
        font-size: 1.2rem;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }

    .cart-item-qty {
        grid-area: qty;
        display: flex;
        align-items: center;
        gap: clamp(6px, 2vw, 12px);
        justify-self: start;
    }

    .qty-btn {
        background: none;
        border: none;
        font-size: 1.1rem;
        cursor: pointer;
        padding: 0 2px;
    }

    .qty-num,
    .qty-value {
        font-size: 0.9rem;
    }

    .cart-item-price-col,
    .cart-item-price,
    .cart-item-total {
        grid-area: price;
        justify-self: end;
        font-size: clamp(0.9rem, 3.2vw, 1.05rem);
        font-weight: 500;
        white-space: nowrap;
    }

    /* 3. Full-width summary box below items */
    .cart-summary {
        width: 100%;
        box-sizing: border-box;
    }
}
/* ========================================================================== 
   V10 — Checkout / Buy Now Flow
   ========================================================================== */

.cart-page {
    padding: 9rem clamp(1rem, 4vw, 4rem) 6rem;
    min-height: 100vh;
}

.cart-container.checkout-shell {
    width: min(1240px, 100%);
    max-width: none;
    margin: 0 auto;
}

.checkout-heading {
    max-width: 700px;
    margin-bottom: 2.75rem;
}

.checkout-eyebrow,
.summary-eyebrow,
.panel-kicker {
    font-family: var(--font-sans);
    font-size: .7rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(43, 38, 31, .62);
}

.checkout-heading .cart-title {
    margin: .35rem 0 .65rem;
    font-size: clamp(2.7rem, 6vw, 4.4rem);
    line-height: .95;
}

.checkout-intro {
    max-width: 610px;
    color: rgba(43, 38, 31, .72);
    font-family: var(--font-sans);
    font-size: .9rem;
    line-height: 1.75;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
    gap: clamp(1.4rem, 4vw, 3.5rem);
    align-items: start;
}

.checkout-main-column {
    min-width: 0;
}

.checkout-panel {
    background: rgba(250, 247, 239, .58);
    border: 1px solid rgba(43, 38, 31, .13);
    border-radius: 22px;
    padding: clamp(1.1rem, 2.6vw, 2rem);
    margin-bottom: 1.25rem;
    backdrop-filter: blur(6px);
}

.panel-heading-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-end;
    padding-bottom: 1.25rem;
    margin-bottom: .25rem;
    border-bottom: 1px solid rgba(43, 38, 31, .11);
}

.panel-heading-row h2 {
    margin: .3rem 0 0;
    font-family: var(--font-serif);
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-weight: 400;
    line-height: 1;
}

.edit-order-link {
    font-family: var(--font-sans);
    font-size: .72rem;
    color: var(--text-dark);
    text-underline-offset: 4px;
}

.order-products-panel .cart-items-list {
    margin: 0;
}

.order-products-panel .cart-item {
    grid-template-columns: 92px minmax(0, 1fr) auto auto 28px;
    gap: 1rem;
    padding: 1.2rem 0;
    border-color: rgba(43, 38, 31, .1);
}

.order-products-panel .cart-item:last-child {
    padding-bottom: .15rem;
    border-bottom: 0;
}

.order-products-panel .cart-item-image {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1 / 1.1;
    background: rgba(255, 255, 255, .35);
}

.order-products-panel .cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform .35s ease;
}

.order-products-panel .cart-item-image:hover img {
    transform: scale(1.035);
}

.order-products-panel .cart-item-title {
    display: inline-block;
    font-family: var(--font-serif);
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.15;
}

.order-products-panel .cart-item-price,
.order-products-panel .cart-item-meta {
    font-family: var(--font-sans);
    font-size: .73rem;
    color: rgba(43, 38, 31, .62);
}

.order-products-panel .cart-item-meta {
    display: inline-block;
    margin-top: .35rem;
}

.order-products-panel .cart-item-qty {
    background: rgba(255, 255, 255, .3);
    border: 1px solid rgba(43, 38, 31, .12);
    border-radius: 999px;
    padding: .18rem .4rem;
    gap: .25rem;
}

.order-products-panel .qty-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 400;
}

.order-products-panel .qty-value {
    min-width: 26px;
    padding: 0 .2rem;
    font-family: var(--font-sans);
    font-size: .78rem;
}

.order-products-panel .cart-item-total {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: .86rem;
    color: var(--text-dark);
}

.order-products-panel .cart-item-remove {
    color: rgba(43, 38, 31, .5);
    font-weight: 300;
}

.checkout-form {
    display: none;
}

body.checkout-open .checkout-form {
    display: block;
    animation: checkoutReveal .4s ease both;
}

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

.form-grid {
    display: grid;
    gap: 1rem;
    padding-top: 1.2rem;
}

.form-grid.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    min-width: 0;
}

.field-group.full-width {
    grid-column: 1 / -1;
}

.field-group > span {
    font-family: var(--font-sans);
    font-size: .73rem;
    letter-spacing: .05em;
    color: rgba(43, 38, 31, .76);
}

.field-group small {
    font-size: .68rem;
    opacity: .65;
}

.field-group input,
.field-group textarea {
    width: 100%;
    border: 1px solid rgba(43, 38, 31, .15);
    border-radius: 11px;
    background: rgba(255, 255, 255, .34);
    color: var(--text-dark);
    padding: .95rem 1rem;
    font-family: var(--font-sans);
    font-size: .86rem;
    outline: none;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
    user-select: text;
    -webkit-user-select: text;
}

.field-group textarea {
    resize: vertical;
    min-height: 92px;
}

.field-group input:focus,
.field-group textarea:focus {
    border-color: rgba(43, 38, 31, .48);
    background: rgba(255, 255, 255, .55);
    box-shadow: 0 0 0 3px rgba(43, 38, 31, .06);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    padding-top: 1.2rem;
}

.choice-card,
.payment-choice {
    position: relative;
    cursor: pointer;
}

.choice-card input,
.payment-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: .9rem;
    align-items: center;
    min-height: 108px;
    border: 1px solid rgba(43, 38, 31, .15);
    border-radius: 16px;
    padding: 1rem;
    background: rgba(255, 255, 255, .25);
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.choice-card:hover,
.choice-card.selected {
    border-color: rgba(43, 38, 31, .55);
    background: rgba(255, 255, 255, .47);
}

.choice-card:hover {
    transform: translateY(-1px);
}

.choice-icon {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(43, 38, 31, .16);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
}

.choice-content,
.payment-choice > span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.choice-content strong,
.payment-choice strong,
.pickup-note strong {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 500;
}

.choice-content small,
.payment-choice small,
.pickup-note p {
    font-family: var(--font-sans);
    font-size: .68rem;
    line-height: 1.55;
    color: rgba(43, 38, 31, .62);
}

.conditional-fields[hidden] {
    display: none !important;
}

.pickup-note {
    margin-top: 1.1rem;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(43, 38, 31, .055);
}

.pickup-note p {
    margin: .35rem 0 0;
}

.payment-list {
    display: grid;
    gap: .65rem;
    padding-top: 1.2rem;
}

.payment-choice {
    display: grid;
    grid-template-columns: 1fr 26px;
    gap: 1rem;
    align-items: center;
    border: 1px solid rgba(43, 38, 31, .13);
    border-radius: 13px;
    padding: .95rem 1rem;
    background: rgba(255, 255, 255, .22);
    transition: border-color .2s ease, background .2s ease;
}

.payment-choice.selected {
    border-color: rgba(43, 38, 31, .52);
    background: rgba(255, 255, 255, .48);
}

.choice-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--text-dark);
    color: var(--bg-main);
    font-family: var(--font-sans);
    font-size: .68rem;
    opacity: 0;
    transform: scale(.75);
    transition: opacity .2s ease, transform .2s ease;
}

.payment-choice.selected .choice-check {
    opacity: 1;
    transform: scale(1);
}

.checkout-summary-column {
    position: sticky;
    top: 2rem;
}

.cart-summary.checkout-summary-card {
    width: 100%;
    margin: 0;
    display: block;
    padding: 1.6rem;
    background: #2b261f;
    color: #f2e9d7;
    border: 0;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(43, 38, 31, .12);
}

.checkout-summary-card .summary-eyebrow {
    color: rgba(242, 233, 215, .55);
    margin-bottom: 1.35rem;
}

.summary-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1.5rem;
    padding: .7rem 0;
    font-family: var(--font-sans);
    font-size: .76rem;
    color: rgba(242, 233, 215, .72);
    border-bottom: 1px solid rgba(242, 233, 215, .1);
}

.summary-line span:last-child,
.summary-line strong {
    text-align: right;
}

.summary-line.total-line {
    margin-top: .55rem;
    padding: 1rem 0 1.25rem;
    border-bottom: 0;
    color: #f2e9d7;
    font-family: var(--font-serif);
    font-size: 1.3rem;
}

.summary-line.total-line strong {
    font-size: 1.55rem;
    font-weight: 500;
}

.checkout-btn,
.place-order-btn {
    width: 100%;
    border: 1px solid #d8c397;
    border-radius: 999px;
    padding: 1rem 1.2rem;
    font-family: var(--font-sans);
    font-size: .72rem;
    letter-spacing: .12em;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.checkout-btn,
.place-order-btn {
    background: #d8c397;
    color: #2b261f;
}

.checkout-btn:hover,
.place-order-btn:hover {
    background: #eadbb8;
    transform: translateY(-1px);
}

.checkout-btn[hidden],
.place-order-btn[hidden] {
    display: none !important;
}

.summary-note {
    margin: .9rem 0 0;
    font-family: var(--font-sans);
    font-size: .62rem;
    line-height: 1.5;
    text-align: center;
    color: rgba(242, 233, 215, .48);
}

.checkout-error {
    margin: .8rem 0 1.25rem;
    padding: .85rem 1rem;
    border: 1px solid rgba(116, 31, 31, .24);
    border-radius: 10px;
    background: rgba(116, 31, 31, .08);
    color: #6d2525;
    font-family: var(--font-sans);
    font-size: .75rem;
}

.checkout-error[hidden] {
    display: none !important;
}

.order-success {
    width: min(680px, 100%);
    margin: 5vh auto 0;
    text-align: center;
    padding: clamp(2rem, 6vw, 4.5rem);
    border: 1px solid rgba(43, 38, 31, .13);
    border-radius: 26px;
    background: rgba(250, 247, 239, .6);
}

.order-success[hidden] {
    display: none !important;
}

.success-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--text-dark);
    color: var(--bg-main);
    font-family: var(--font-sans);
    font-size: 1.2rem;
}

.order-success h2 {
    margin: .45rem 0 1rem;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 400;
}

.order-success > p:not(.checkout-eyebrow) {
    font-family: var(--font-sans);
    font-size: .82rem;
    line-height: 1.7;
}

.success-subtext {
    color: rgba(43, 38, 31, .62);
    margin-top: .4rem;
}

.success-actions {
    margin-top: 1.7rem;
}

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

    .checkout-summary-column {
        position: static;
    }

    .checkout-summary-card {
        max-width: none;
    }
}

@media (max-width: 700px) {
    .cart-page {
        padding: 7rem 1rem 3.5rem;
    }

    .checkout-heading {
        margin-bottom: 1.6rem;
    }

    .checkout-panel {
        padding: 1rem;
        border-radius: 16px;
    }

    .panel-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .order-products-panel .cart-item {
        grid-template-columns: 76px minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "img info remove"
            "img qty total";
        gap: .7rem .85rem;
    }

    .order-products-panel .cart-item-image { grid-area: img; }
    .order-products-panel .cart-item-info { grid-area: info; }
    .order-products-panel .cart-item-qty { grid-area: qty; }
    .order-products-panel .cart-item-total { grid-area: total; justify-self: end; }
    .order-products-panel .cart-item-remove { grid-area: remove; align-self: start; }

    .order-products-panel .cart-item-title {
        font-size: 1.05rem;
    }

    .form-grid.two-cols,
    .choice-grid {
        grid-template-columns: 1fr;
    }

    .field-group.full-width {
        grid-column: auto;
    }

    .choice-card {
        min-height: 94px;
    }

    .cart-summary.checkout-summary-card {
        border-radius: 16px;
    }
}

@media (max-width: 420px) {
    .cart-page {
        padding-inline: .75rem;
    }

    .checkout-panel {
        padding: .85rem;
    }

    .order-products-panel .cart-item {
        grid-template-columns: 64px minmax(0, 1fr) auto;
    }

    .order-products-panel .cart-item-qty {
        padding: .12rem .25rem;
    }

    .order-products-panel .qty-btn {
        width: 26px;
        height: 26px;
    }
}

/* Once checkout opens, finish with the summary beside the last form section.
   The existing single-column layout places it after the form on small screens. */
body.checkout-open .checkout-summary-column {
    position: static;
    align-self: end;
}
