/* Design System for Mua Day! v2 storefront */
:root {
    /* Primary */
    --primary-color: #4A7C24;
    --primary-dark: #365D19;
    --primary-hover: #3F6B1E;
    --primary-light: rgba(74, 124, 36, 0.10);
    --primary-border: rgba(74, 124, 36, 0.20);

    /* Accent */
    --accent-color: #F87831;
    --accent-dark: #E06A29;
    --accent-light: rgba(248, 120, 49, 0.10);
    --accent-border: rgba(248, 120, 49, 0.20);

    /* Warm neutral surfaces */
    --cream: #F8F7F4;
    --cream-strong: #FEF9E6;
    --mint: #F8F7F4;
    --mint-border: var(--primary-border);
    --mint-text: var(--primary-color);

    /* Background & Surface */
    --bg-app: #E5E7EB;
    --surface: #FFFFFF;
    --surface-soft: #F8F7F4;

    /* Text */
    --text-main: #1F2937;
    --text-dark: #1F2937;
    --text-sub: #4B5563;
    --text-muted: #6B7280;
    --text-soft: #9CA3AF;

    /* Border */
    --border-color: rgba(74, 124, 36, 0.16);
    --border-light: rgba(74, 124, 36, 0.10);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-green: 0 14px 28px rgba(74, 124, 36, 0.32);
    --shadow-orange: 0 10px 22px rgba(248, 120, 49, 0.26);
}

body.sv2-body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* Lucide SVG Icons global rules */
svg.lucide {
    width: 1em;
    height: 1em;
    stroke-width: 2.2px;
    vertical-align: middle;
}

/* Mobile-first container — max 500px centered, shadow on desktop */
.sv2-container {
    max-width: 500px;
    margin: 0 auto;
    background-color: var(--surface-soft);
    min-height: 100vh;
    position: relative;
    box-shadow: var(--shadow-xl);
    padding-bottom: 96px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Desktop: show side padding/margin so card floats on bg */
@media (min-width: 768px) {
    body.sv2-body {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 32px 16px;
        min-height: 100vh;
    }

    .sv2-container {
        max-width: 800px;
        border-radius: 18px;
        min-height: calc(100vh - 64px);
        overflow: hidden;
    }

    .sv2-drawer {
        left: 50%;
        right: auto;
        transform: translate(-50%, 100%);
        width: 800px;
        max-width: 800px;
    }

    .sv2-drawer.active {
        transform: translate(-50%, 0);
    }
}

/* Header styling */
.sv2-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: var(--surface-soft);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-light);
    box-sizing: border-box;
}

.sv2-header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 0;
    text-decoration: none;
}

.sv2-header-brand-icon svg,
.sv2-header-brand-icon {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
    stroke-width: 2.5px;
}

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

.sv2-header-history {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 36px;
    padding: 0 9px;
    border: 1px solid var(--primary-border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-sub);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.sv2-header-history[hidden] {
    display: none;
}

.sv2-header-history svg {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
}

.sv2-header-history:hover {
    border-color: var(--accent-border);
    background: var(--cream-strong);
    color: var(--accent-color);
}

.sv2-header-cart {
    position: relative;
    background-color: transparent;
    border: none;
    padding: 0;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    font-size: 1.25rem;
}

.sv2-header-cart svg {
    width: 25px;
    height: 25px;
    stroke-width: 2px;
}

.sv2-header-cart:hover {
    color: var(--accent-color);
    background-color: transparent;
    transform: scale(1.05);
}

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

.sv2-cart-badge {
    position: absolute;
    top: 3px;
    right: 2px;
    background-color: var(--accent-color);
    color: white;
    font-size: 9px;
    font-weight: 800;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    box-shadow: 0 2px 6px rgba(248, 120, 49, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sv2-cart-badge.active {
    transform: scale(1);
}

/* Banner gradient */
.sv2-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 24px 32px 24px;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

.sv2-banner-avatar {
    width: 64px;
    height: 64px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--cream);
    margin-bottom: 12px;
    overflow: hidden;
}

.sv2-banner-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sv2-banner-name {
    margin: 0 0 5px 0;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.22;
}

.sv2-banner-phone {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin-bottom: 5px;
}

.sv2-banner-phone svg,
.sv2-banner-address svg {
    width: 14px;
    height: 14px;
    stroke-width: 2px;
}

.sv2-banner-address {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    opacity: 0.9;
    max-width: 90%;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Search floating wrapper */
.sv2-search-wrapper {
    padding: 0 16px;
    margin-top: -20px;
    position: relative;
    z-index: 20;
    box-sizing: border-box;
}

.sv2-search-box {
    background-color: white;
    padding: 8px 12px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--primary-border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sv2-search-icon {
    color: rgba(74, 124, 36, 0.55);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
}

.sv2-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text-dark);
    padding: 6px 0;
}

.sv2-search-input::placeholder {
    color: var(--text-soft);
}

.sv2-search-input:focus {
    outline: none;
}

/* Categories Scroll */
.sv2-categories-container {
    margin-top: 16px;
    padding: 0 16px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
}

.sv2-categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 0;
    scroll-behavior: smooth;
    width: 100%;
}

/* Hide scrollbar trick */
.sv2-categories-scroll::-webkit-scrollbar {
    display: none;
}

.sv2-categories-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Navigation buttons styling */
.sv2-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scale(1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 1.5px solid var(--primary-border);
    box-shadow: 0 4px 10px rgba(74, 124, 36, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: var(--primary-color);
    font-size: 1.125rem;
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s, color 0.2s, border-color 0.2s;
    outline: none;
}

.sv2-nav-btn:hover,
.sv2-nav-btn:active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 124, 36, 0.25);
}

.sv2-nav-btn.prev {
    left: 8px;
}

.sv2-nav-btn.next {
    right: 8px;
}

.sv2-nav-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.8);
}

.sv2-cat-btn {
    white-space: nowrap;
    padding: 6px 16px;
    background-color: var(--surface);
    color: var(--text-sub);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid var(--primary-border);
    cursor: pointer;
    transition: all 0.2s;
}

.sv2-cat-btn:hover {
    background-color: var(--cream-strong);
    color: var(--primary-color);
    border-color: var(--primary-border);
}

.sv2-cat-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74, 124, 36, 0.24);
}

.sv2-instruction-text {
    font-size: 0.75rem;
    color: rgba(74, 124, 36, 0.72);
    text-align: center;
    margin: 8px 0 0 0;
    font-style: italic;
}

.sv2-order-memory {
    margin: 12px 16px 0;
    overflow: hidden;
    border: 1px solid var(--primary-border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.sv2-memory-draft {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--primary-light);
}

.sv2-memory-draft[hidden] {
    display: none;
}

.sv2-memory-icon {
    display: flex;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    color: var(--primary-color);
}

.sv2-memory-icon svg {
    width: 17px;
    height: 17px;
}

.sv2-memory-content {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.sv2-memory-content strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.8rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sv2-memory-content span {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.sv2-memory-clear {
    padding: 5px 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
}

.sv2-memory-clear:hover {
    color: var(--accent-color);
}

/* Product list area */
.sv2-products-list {
    padding: 0 16px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .sv2-products-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
        margin-top: 20px;
    }
}

.sv2-product-card {
    display: flex;
    align-items: center;
    padding: 12px;
    min-height: 90px;
    background-color: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.sv2-product-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-border);
}

.sv2-product-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background-color: var(--surface-soft);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.sv2-product-img.placeholder {
    object-fit: contain;
    padding: 12px;
    background-color: var(--cream-strong);
    border-color: var(--primary-border);
    opacity: 1;
}

.sv2-product-info {
    margin-left: 12px;
    flex: 1;
    min-width: 0;
    padding-right: 4px;
}

.sv2-product-name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.sv2-product-note {
    font-size: 0.75rem;
    color: var(--text-soft);
    margin: 4px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sv2-product-prices {
    margin-top: 5px;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.sv2-product-price {
    color: var(--accent-color);
    font-weight: 800;
    font-size: 0.875rem;
    margin: 6px 0 0 0;
}

.sv2-product-old-price {
    color: var(--text-muted);
    text-decoration: line-through;
    font-size: 0.75rem;
    margin: 0;
}

.sv2-product-discount {
    color: var(--accent-color);
    font-size: 0.7rem;
    font-weight: 600;
}

.sv2-product-actions {
    margin-left: 8px;
    flex-shrink: 0;
}

.sv2-product-add-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--surface-soft);
    color: var(--primary-color);
    border: 1.5px solid var(--primary-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sv2-product-add-btn i {
    font-size: 1.2rem;
}

.sv2-product-add-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.6px;
}

.sv2-product-add-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 124, 36, 0.2);
}

.sv2-product-add-btn:active {
    transform: scale(0.9);
}

.sv2-product-qtty-control {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--primary-border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.sv2-product-actions.in-cart .sv2-product-add-btn {
    display: none;
}

.sv2-product-actions.in-cart .sv2-product-qtty-control {
    display: flex;
}

.sv2-product-qtty-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--surface-soft);
    color: var(--text-sub);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s, transform 0.2s;
}

.sv2-product-qtty-btn.plus {
    background: var(--primary-light);
    color: var(--primary-color);
}

.sv2-product-qtty-btn:hover {
    background: var(--cream-strong);
    color: var(--primary-color);
}

.sv2-product-qtty-btn:active {
    transform: scale(0.9);
}

.sv2-product-qtty-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5px;
}

.sv2-product-qtty {
    min-width: 22px;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

/* Pagination area */
.sv2-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 16px;
    border-top: 1px solid var(--border-light);
    margin-top: 16px;
    box-sizing: border-box;
}

.sv2-page-list {
    display: flex;
    gap: 4px;
}

.sv2-page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--primary-border);
    background-color: white;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.sv2-page-btn:hover {
    background-color: var(--cream-strong);
    border-color: var(--primary-border);
}

.sv2-page-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.sv2-page-btn.disabled {
    color: #D1D5DB;
    cursor: not-allowed;
    pointer-events: none;
}

.sv2-pagination-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Contact Store info */
.sv2-contact-section {
    padding: 0 16px;
    margin-bottom: 32px;
    box-sizing: border-box;
}

.sv2-contact-card {
    background-color: var(--surface);
    border: 1px solid var(--primary-border);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.sv2-contact-title {
    margin: 0 0 12px 0;
    font-size: 0.875rem;
    color: var(--mint-text);
    font-weight: 700;
}

.sv2-contact-buttons {
    display: flex;
    justify-content: center;
    gap: 24px;
}

.sv2-contact-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-sizing: border-box;
}

.sv2-contact-btn svg {
    width: 17px;
    height: 17px;
    stroke-width: 2.2px;
}

.sv2-contact-btn.phone {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.sv2-contact-btn.phone:hover {
    background-color: var(--cream-strong);
}

.sv2-contact-btn.zalo {
    background-color: #0068FF;
    color: white;
    border: 1px solid #0068FF;
    box-shadow: var(--shadow-sm);
}

.sv2-contact-btn.zalo:hover {
    background-color: #0056d6;
}

/* 🚀 Footer & Strategic SEO links */
.sv2-footer {
    background-color: var(--surface-soft);
    border-top: none;
    padding: 18px 16px 24px;
    text-align: center;
    box-sizing: border-box;
    margin-top: 8px;
    opacity: 0.78;
    transition: opacity 0.2s;
}

.sv2-footer:hover {
    opacity: 1;
}

.sv2-footer-text {
    font-size: 0.72rem;
    color: rgba(74, 124, 36, 0.72);
    margin: 0;
    line-height: 1.5;
    font-weight: 600;
}

.sv2-footer-text a {
    color: var(--primary-color);
    font-weight: 800;
    text-decoration: none;
    transition: underline 0.2s;
}

.sv2-footer-text a:hover {
    text-decoration: underline;
}

/* Sticky Bottom Cart (Slide-up panel trigger) */
.sv2-sticky-cart-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    pointer-events: none;
}

.sv2-sticky-cart-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
    pointer-events: auto;
}

@media (min-width: 768px) {
    .sv2-sticky-cart-wrapper {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 800px;
        bottom: 32px;
    }

    .sv2-sticky-cart-container {
        max-width: 100%;
        padding: 16px 24px;
    }
}

.sv2-sticky-cart {
    background-color: var(--primary-color);
    border-radius: 16px;
    box-shadow: var(--shadow-green);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    transform: translateY(120px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(248, 247, 244, 0.22);
}

.sv2-sticky-cart.active {
    transform: translateY(0);
}

.sv2-sticky-cart-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sv2-sticky-cart-icon-box {
    position: relative;
    display: flex;
    align-items: center;
}

.sv2-sticky-cart-icon-box svg,
.sv2-sticky-cart-icon-box i {
    width: 30px;
    height: 30px;
    font-size: 1.75rem;
    stroke-width: 2px;
}

.sv2-sticky-cart-count {
    position: absolute;
    top: -5px;
    right: -7px;
    background-color: var(--accent-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    height: 17px;
    width: 17px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
}

.sv2-sticky-cart-summary-text {
    font-size: 0.75rem;
    color: rgba(254, 249, 230, 0.85);
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

.sv2-sticky-cart-total {
    font-size: 1.125rem;
    font-weight: 800;
    margin: 2px 0 0 0;
    line-height: 1.2;
    color: var(--cream-strong);
}

.sv2-sticky-cart-btn {
    background-color: var(--accent-color);
    color: white;
    font-weight: 700;
    font-size: 0.875rem;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-orange);
    transition: all 0.2s;
    letter-spacing: 0;
    white-space: nowrap;
}

.sv2-sticky-cart-btn:hover {
    background-color: var(--accent-dark);
    color: white;
}

.sv2-sticky-cart-btn:active {
    transform: scale(0.95);
}

/* Micro-animations */
@keyframes sv2-bump {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }

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

.sv2-animate-bump {
    animation: sv2-bump 0.3s ease-out;
}

/* Slide-up Cart Panel (Overlay & Drawer) */
.sv2-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(31, 41, 55, 0.55);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.sv2-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sv2-history-overlay {
    position: fixed;
    inset: 0;
    z-index: 1010;
    visibility: hidden;
    background: rgba(31, 41, 55, 0.55);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sv2-history-overlay.active {
    visibility: visible;
    opacity: 1;
}

.sv2-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--surface-soft);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 1001;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 448px;
    margin: 0 auto;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .sv2-drawer {
        max-width: 800px;
    }
}

.sv2-drawer.active {
    transform: translateY(0);
}

.sv2-history-sheet {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1011;
    display: flex;
    max-width: 448px;
    max-height: min(75vh, 620px);
    margin: 0 auto;
    flex-direction: column;
    overflow: hidden;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    background: var(--surface-soft);
    box-shadow: 0 -12px 35px rgba(31, 41, 55, 0.16);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sv2-history-sheet.active {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .sv2-history-sheet {
        top: 50%;
        right: auto;
        bottom: auto;
        left: 50%;
        width: min(680px, calc(100% - 48px));
        max-width: none;
        min-height: 360px;
        max-height: min(70vh, 620px);
        margin: 0;
        border-radius: 24px;
        box-shadow: 0 24px 70px rgba(31, 41, 55, 0.24);
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, calc(-50% + 20px)) scale(0.98);
        transition:
            opacity 0.2s ease,
            transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sv2-history-sheet.active {
        opacity: 1;
        pointer-events: auto;
        transform: translate(-50%, -50%) scale(1);
    }
}

.sv2-drawer-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sv2-drawer-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--primary-color);
}

.sv2-drawer-close {
    background: var(--surface);
    border: 1px solid var(--primary-border);
    border-radius: 9999px;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    line-height: 1;
}

.sv2-history-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
}

.sv2-history-title-wrap svg {
    width: 20px;
    height: 20px;
}

.sv2-history-content {
    min-height: 0;
    padding: 4px 16px;
    flex: 1;
    overflow-y: auto;
}

.sv2-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
    color: inherit;
    text-decoration: none;
}

.sv2-history-item:last-child {
    border-bottom: 0;
}

.sv2-history-item-content {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 4px;
}

.sv2-history-item-content strong {
    overflow: hidden;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sv2-history-item-content small {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.sv2-history-item-total {
    flex-shrink: 0;
    color: var(--text-sub);
    font-size: 0.86rem;
    font-weight: 700;
}

.sv2-history-footer {
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.sv2-history-clear {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}

.sv2-history-clear:hover {
    color: var(--accent-color);
}

.sv2-drawer-content {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Drawer Cart items List */
.sv2-drawer-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.sv2-drawer-empty i {
    font-size: 3rem;
    color: var(--primary-border);
    margin-bottom: 16px;
    display: block;
}

.sv2-cart-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.sv2-cart-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-dark);
}

.sv2-cart-item-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.sv2-cart-item-oldprice {
    text-decoration: line-through;
    color: var(--text-soft);
    margin-left: 4px;
}

.sv2-cart-item-price-sum {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-right: 16px;
    white-space: nowrap;
}

.sv2-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sv2-qtty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--surface);
    color: var(--text-dark);
    border: 1px solid var(--primary-border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}

.sv2-qtty-btn:hover {
    background-color: var(--cream-strong);
}

.sv2-qtty-btn.plus {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.sv2-qtty-btn.plus:hover {
    background-color: var(--primary-color);
    color: white;
}

.sv2-item-qtty {
    font-size: 0.875rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.sv2-cart-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 2px dashed var(--primary-border);
}

.sv2-cart-total-price {
    color: var(--accent-color);
}

/* Customer details form */
.sv2-customer-form {
    margin-top: 16px;
}

.sv2-customer-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0 0 12px 0;
}

.sv2-form-group {
    margin-bottom: 12px;
}

.sv2-form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 4px;
}

.sv2-input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--primary-border);
    border-radius: 12px;
    background-color: var(--surface);
    padding: 0 12px;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.sv2-input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 36, 0.12);
    background-color: white;
}

.sv2-input-group svg,
.sv2-input-group i {
    color: rgba(74, 124, 36, 0.50);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sv2-form-control {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 12px 0 !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    font-size: 0.9rem;
    color: var(--text-main);
    box-shadow: none !important;
}

.sv2-form-control:focus {
    outline: none !important;
    box-shadow: none !important;
}

.sv2-form-control-textarea {
    width: 100%;
    border: 1px solid var(--primary-border);
    border-radius: 12px;
    background-color: var(--surface);
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-main);
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.sv2-form-control-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 124, 36, 0.12);
    background-color: white;
}

.sv2-form-error {
    font-size: 0.75rem;
    color: #DC2626;
    margin-top: 4px;
    display: none;
}

.sv2-form-submit-btn {
    width: 100%;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-orange);
    margin-top: 16px;
    transition: all 0.2s;
}

.sv2-form-submit-btn:hover {
    background-color: var(--accent-dark);
}

.sv2-form-submit-btn:active {
    transform: scale(0.98);
}

.sv2-form-submit-btn.disabled {
    background-color: #D1D5DB;
    cursor: not-allowed;
    box-shadow: none;
}

.sv2-form-submit-btn.disabled:active {
    transform: none;
}

.sv2-form-processing {
    text-align: center;
    color: var(--primary-color);
    font-size: 0.875rem;
    margin-top: 8px;
    display: none;
}

.sv2-form-terms {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 12px;
}

.sv2-form-terms a {
    color: var(--primary-color);
    text-decoration: none;
}

.sv2-form-terms a:hover {
    text-decoration: underline;
}

/* Spinner */
.sv2-spinner {
    border: 3px solid rgba(74, 124, 36, 0.12);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 24px;
    height: 24px;
    animation: sv2-spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes sv2-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.sv2-no-result {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* --- EMPTY & ERROR STATES --- */
.sv2-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    flex-grow: 1;
    box-sizing: border-box;
}

.sv2-error-card {
    background-color: var(--surface);
    border: 1px solid var(--primary-border);
    border-radius: 20px;
    padding: 40px 24px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 10px 25px -5px rgba(74, 124, 36, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sv2-error-icon-wrapper {
    width: 80px;
    height: 80px;
    background-color: rgba(248, 120, 49, 0.10);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--accent-color);
}

.sv2-error-icon-wrapper.warning {
    background-color: var(--accent-light);
    color: var(--accent-color);
}

.sv2-error-icon-wrapper svg {
    width: 40px;
    height: 40px;
}

.sv2-error-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.sv2-error-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 28px 0;
    line-height: 1.6;
    max-width: 280px;
}

.sv2-error-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-orange);
}

.sv2-error-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(248, 120, 49, 0.3);
    background-color: var(--accent-dark);
}

.sv2-error-btn:active {
    transform: translateY(0);
}

.sv2-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
    flex-grow: 1;
}

.sv2-empty-icon-wrapper {
    width: 96px;
    height: 96px;
    background-color: var(--cream-strong);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 20px rgba(74, 124, 36, 0.08);
}

.border-danger {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.10) !important;
}

.sv2-empty-icon-wrapper svg {
    width: 44px;
    height: 44px;
}

.sv2-empty-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px 0;
}

.sv2-empty-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}
