/* =========================================================
   Sade Jajan - Snack Box Ordering Design System
   Bright, Clean, Professional & Mobile-first Responsive CSS
   ========================================================= */

:root {
    --primary: #ea580c;
    --primary-hover: #c2410c;
    --primary-light: #fff7ed;
    --primary-subtle: #ffedd5;

    --accent: #d97706;
    --accent-light: #fef3c7;
    --accent-dark: #b45309;

    --success: #16a34a;
    --success-light: #dcfce7;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --info: #0284c7;
    --info-light: #e0f2fe;

    --bg-body: #faf8f5;
    --bg-surface: #ffffff;
    --bg-subtle: #f8fafc;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --border-focus: #ea580c;

    --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 -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.09), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Accessible Tap & Focus */
a,
button,
input,
select,
textarea {
    font-family: inherit;
    color: inherit;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

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

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.25;
}

h1 {
    font-size: 1.85rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Layout Containers */
.container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 0.85rem;
}

@media (min-width: 640px) {
    .container {
        padding-inline: 1.25rem;
    }
}

.container-narrow {
    max-width: 900px;
}

/* Header & Navbar */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 0.5rem;
    min-width: 0;
}

@media (min-width: 640px) {
    .navbar {
        height: 72px;
    }
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    min-width: 0;
    flex-shrink: 1;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: contain;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .brand-logo {
        width: 44px;
        height: 44px;
    }
}

.brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .brand-name {
        font-size: 1.25rem;
    }
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: none;
}

@media (min-width: 768px) {
    .brand-tagline {
        display: block;
        max-width: 300px;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.nav-btn-text {
    display: none;
}

@media (min-width: 640px) {
    .nav-btn-text {
        display: inline;
    }
}

/* Hero Section */
.hero-banner {
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 50%, #ffffff 100%);
    border-bottom: 1px solid var(--border);
    padding: 1.75rem 0 1.5rem;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .hero-banner {
        padding: 2.5rem 0 2rem;
    }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
}

@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 1.3fr 0.9fr;
        padding-block: 1rem;
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #ffffff;
    border: 1px solid var(--accent);
    color: var(--accent-dark);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.hero-title {
    font-size: 1.65rem;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
    color: #1c1917;
    line-height: 1.25;
    word-break: break-word;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 2.15rem;
    }
}

.hero-title span {
    color: var(--primary);
    position: relative;
}

.hero-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    max-width: 540px;
    line-height: 1.45;
}

@media (min-width: 768px) {
    .hero-desc {
        font-size: 1.05rem;
    }
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.85);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

.hero-visual {
    display: flex;
    justify-content: center;
    position: relative;
    width: 100%;
}

.hero-illustration {
    width: 100%;
    max-width: 100%;
    background: #ffffff;
    border-radius: var(--radius-xl);
    padding: 1.15rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transform: none;
    transition: var(--transition);
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .hero-illustration {
        max-width: 320px;
        padding: 1.25rem;
        box-shadow: var(--shadow-lg);
        transform: rotate(1.5deg);
    }
    .hero-illustration:hover {
        transform: rotate(0deg) scale(1.02);
    }
}

/* Main Layout: Builder & Sticky Sidebar */
.order-workspace {
    padding-block: 1.5rem 5rem;
}

@media (min-width: 768px) {
    .order-workspace {
        padding-block: 2rem 5rem;
    }
}

.builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 1024px) {
    .builder-layout {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 2rem;
    }
}

.builder-steps {
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

/* Step Header */
.step-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    padding: 1rem 0.85rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .step-card {
        padding: 1.5rem;
        margin-bottom: 1.75rem;
    }
}

.step-card:focus-within {
    border-color: var(--primary-subtle);
}

.step-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    min-width: 0;
}

@media (min-width: 640px) {
    .step-header {
        gap: 0.85rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.85rem;
    }
}

.step-number {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.step-title-wrap {
    flex: 1;
    min-width: 0;
}

.step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

@media (min-width: 640px) {
    .step-title {
        font-size: 1.25rem;
    }
}

.step-subtitle {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

@media (min-width: 640px) {
    .step-subtitle {
        font-size: 0.85rem;
    }
}

/* Package Preset Cards ( disusun dari Backend ) */
.package-preset-card {
    background: linear-gradient(180deg, #fffcf9 0%, #ffffff 100%);
    border: 2px solid #fed7aa;
}

.packages-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .packages-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

.package-item-card {
    background: #ffffff;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    box-shadow: var(--shadow-sm);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .package-item-card {
        padding: 1.35rem;
    }
}

.package-item-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.package-item-card.is-selected {
    border-color: #059669;
    background: #f0fdf4;
    box-shadow: 0 0 0 2px #059669, var(--shadow-md);
}

.package-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.package-price-tag {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 900;
    white-space: nowrap;
}

.package-price-tag small {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.package-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.4rem;
    line-height: 1.25;
}

.package-card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.85rem;
}

.package-box-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.85rem;
    border: 1px solid var(--border);
}

.package-snack-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.package-snack-pill {
    font-size: 0.8rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    color: #334155;
    line-height: 1.25;
}

.package-item-card.is-selected .package-snack-pill {
    background: #ffffff;
    border-color: #a7f3d0;
    color: #065f46;
}

/* Packaging Options Grid */
.packaging-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
    width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .packaging-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

.packaging-option {
    position: relative;
    display: block;
    cursor: pointer;
    min-width: 0;
    width: 100%;
}

.packaging-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.packaging-card {
    border: 2px solid var(--border);
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: var(--transition);
    position: relative;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .packaging-card {
        padding: 1rem;
    }
}

.packaging-option input[type="radio"]:checked+.packaging-card {
    border-color: var(--primary);
    background: #fffbf7;
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.packaging-option input[type="radio"]:focus-visible+.packaging-card {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.packaging-top {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.packaging-img-wrap {
    width: 62px;
    height: 62px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.packaging-img-wrap:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    transform: scale(1.04);
}

.packaging-img {
    width: 100%;
    height: 100%;
    border-radius: 0;
    object-fit: cover;
    background: #ffffff;
    display: block;
}

.packaging-info {
    flex: 1;
}

.packaging-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.packaging-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: 0.2rem;
}

.packaging-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: auto;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
}

.check-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.packaging-option input[type="radio"]:checked+.packaging-card .check-indicator {
    border-color: var(--primary);
    background: var(--primary);
}

.packaging-option input[type="radio"]:checked+.packaging-card .check-indicator::after {
    content: "✓";
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
}

/* Category Filter Tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.25rem;
    margin-bottom: 1.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
    min-width: 0;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.cat-tab-btn {
    border: 1px solid var(--border);
    background: #ffffff;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition);
    min-height: 38px;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .cat-tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
        min-height: 42px;
    }
}

.cat-tab-btn:hover {
    background: var(--bg-subtle);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.cat-tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

/* Snack Cards Grid */
.snacks-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .snacks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }
}

.snack-card {
    border: 1.5px solid var(--border);
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    display: flex;
    gap: 0.65rem;
    transition: var(--transition);
    position: relative;
    user-select: none;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .snack-card {
        padding: 0.85rem;
        gap: 0.85rem;
    }
}

.snack-card:hover {
    border-color: #fbcfe8;
    background: #fffdfc;
    box-shadow: var(--shadow-sm);
}

.snack-card.selected {
    border-color: var(--primary);
    background: #fffbf7;
    box-shadow: 0 0 0 1px var(--primary);
}

.snack-img-wrap {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

@media (min-width: 640px) {
    .snack-img-wrap {
        width: 68px;
        height: 68px;
    }
}

.snack-img-wrap:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    transform: scale(1.03);
}

.snack-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    display: block;
}

.snack-zoom-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.snack-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.snack-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.4rem;
    min-width: 0;
}

.snack-title {
    font-size: 0.925rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.snack-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.snack-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-block: 0.25rem 0.5rem;
    line-height: 1.35;
    word-break: break-word;
}

.snack-action-row {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-hover);
}

.badge-accent {
    background: var(--accent-light);
    color: var(--accent-dark);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

/* Custom Checkbox Toggle for Snacks */
.snack-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: #ffffff;
    transition: var(--transition);
}

.snack-card.selected .snack-toggle-label {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.snack-qty-control {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #ffffff;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--bg-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.qty-count {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

/* Order Quantity Stepper (Box Count) */
.box-counter-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    background: #fffaf5;
    border: 1px solid #fed7aa;
    padding: 1rem;
    border-radius: var(--radius-md);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .box-counter-wrapper {
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
        padding: 1.25rem;
    }
}

.counter-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: fit-content;
}

.btn-counter {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: none;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition);
}

@media (min-width: 640px) {
    .btn-counter {
        width: 48px;
        height: 48px;
    }
}

.btn-counter:hover {
    background: var(--bg-subtle);
    color: var(--primary);
}

.input-counter {
    width: 72px;
    height: 44px;
    border: none;
    border-inline: 1px solid var(--border);
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
}

@media (min-width: 640px) {
    .input-counter {
        width: 80px;
        height: 48px;
        font-size: 1.25rem;
    }
}

.preset-pills {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    min-width: 0;
}

.btn-preset {
    border: 1px solid var(--border);
    background: #ffffff;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.825rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-height: 36px;
}

@media (min-width: 640px) {
    .btn-preset {
        padding: 0.45rem 0.85rem;
        font-size: 0.875rem;
        min-height: 40px;
    }
}

.btn-preset:hover,
.btn-preset.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Form Groups & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .form-grid {
        gap: 1.25rem;
    }
    .form-grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.required-star {
    color: var(--danger);
    font-weight: bold;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
    outline: none;
}

/* Modern Validation Pseudo-class */
.form-control:user-invalid {
    border-color: var(--danger);
    background-color: #fef2f2;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    display: none;
}

.form-control:user-invalid+.form-error {
    display: block;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Sticky Order Summary Sidebar */
.order-summary-sidebar {
    position: sticky;
    top: 90px;
}

.summary-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 2px solid #fed7aa;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    overflow: hidden;
    position: relative;
}

.summary-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ea580c, #f59e0b);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.summary-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1c1917;
}

.summary-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.summary-item-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 0.875rem;
}

.summary-item-name {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.summary-item-price {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.summary-divider {
    height: 1px;
    background: var(--border);
    margin-block: 0.85rem;
}

.summary-subtotal {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.summary-grandtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-block: 0.75rem 1rem;
}

.grandtotal-label {
    font-size: 1.05rem;
    font-weight: 800;
    color: #1c1917;
}

.grandtotal-value {
    font-size: 1.65rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.shipping-note {
    background: #fffbeb;
    border: 1px dashed #fde68a;
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    font-size: 0.785rem;
    color: #92400e;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.shipping-note-icon {
    font-size: 0.95rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.lead-time-notice {
    background: var(--accent-light);
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    font-size: 0.8rem;
    color: #92400e;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

/* Primary Action Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
}

.btn-success:hover {
    background: #15803d;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-outline {
    background: #ffffff;
    border: 1.5px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-subtle);
}

.btn-block {
    width: 100%;
    white-space: normal;
    text-align: center;
}

.btn-sm {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    padding: 0.5rem;
    min-height: 38px;
    min-width: 38px;
    border-radius: var(--radius-sm);
}

/* Mobile Sticky Bottom Bar */
.mobile-summary-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 2px solid var(--border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    padding: 0.65rem 0.85rem;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
}

@media (min-width: 640px) {
    .mobile-summary-bar {
        padding: 0.75rem 1.25rem;
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .mobile-summary-bar {
        display: none;
    }
}

.mobile-price-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.mobile-price-label {
    font-size: 0.725rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-price-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    white-space: nowrap;
}

.mobile-shipping-note {
    font-size: 0.65rem;
    color: #b45309;
    font-weight: 600;
    margin-top: 2px;
    line-height: 1.15;
}

/* Alerts & Toasts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.alert-success {
    background: var(--success-light);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: var(--accent-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: var(--info-light);
    color: #075985;
    border: 1px solid #bae6fd;
}

/* Admin Dashboard & Table Styles */
.admin-layout {
    position: relative;
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Sidebar Drawer on Mobile (< 1024px) */
.admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    background: #1e293b;
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-sidebar.is-open {
    transform: translateX(0);
}

.admin-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.admin-sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.admin-sidebar-header {
    padding: 1.15rem 1rem;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.admin-sidebar-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid #475569;
    color: #cbd5e1;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: var(--transition);
    flex-shrink: 0;
}

.admin-sidebar-close:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.admin-nav {
    list-style: none;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.admin-nav-link:hover,
.admin-nav-link.active {
    background: #334155;
    color: #ffffff;
}

.admin-nav-link.active {
    background: var(--primary);
}

/* Admin Main Content & Topbar */
.admin-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    min-width: 0;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.admin-topbar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 0.85rem;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: var(--shadow-sm);
    gap: 0.5rem;
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.btn-toggle-sidebar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: #ffffff;
    font-size: 1.2rem;
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.btn-toggle-sidebar:hover {
    background: var(--bg-subtle);
    border-color: var(--primary);
    color: var(--primary);
}

.admin-topbar-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    line-height: 1.2;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.admin-user-greeting {
    display: none;
}

.admin-logout-btn {
    min-height: 36px;
    padding: 0.35rem 0.65rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
}

.admin-logout-text {
    display: none;
}

.admin-body {
    padding: 1rem 0.85rem;
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Desktop Sidebar & Topbar (>= 1024px) */
@media (min-width: 1024px) {
    .admin-sidebar {
        position: static;
        width: 260px;
        transform: none;
        box-shadow: none;
        flex-shrink: 0;
    }

    .admin-sidebar-backdrop {
        display: none !important;
    }

    .admin-sidebar-close {
        display: none;
    }

    .admin-sidebar-header {
        padding: 1.5rem 1.25rem;
    }

    .btn-toggle-sidebar {
        display: none;
    }

    .admin-topbar {
        height: 70px;
        padding-inline: 1.75rem;
        gap: 1rem;
    }

    .admin-topbar-title {
        font-size: 1.25rem;
    }

    .admin-user-greeting {
        display: inline;
        font-size: 0.875rem;
        color: var(--text-secondary);
    }

    .admin-logout-text {
        display: inline;
    }

    .admin-body {
        padding: 1.75rem;
    }
}

/* Quick Status Banner (Dashboard) */
.admin-status-banner {
    background: linear-gradient(90deg, #ea580c, #f59e0b);
    color: #ffffff;
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    box-shadow: var(--shadow-md);
    min-width: 0;
}

@media (min-width: 640px) {
    .admin-status-banner {
        padding: 1.25rem 1.5rem;
        border-radius: var(--radius-lg);
        margin-bottom: 2rem;
        gap: 1rem;
    }
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    min-width: 0;
    width: 100%;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.25rem;
        margin-bottom: 2rem;
    }
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 0.85rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

@media (min-width: 640px) {
    .stat-card {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
        gap: 1rem;
    }
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .stat-icon {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-md);
        font-size: 1.5rem;
    }
}

.stat-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 640px) {
    .stat-val {
        font-size: 1.65rem;
    }
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.25;
}

@media (min-width: 640px) {
    .stat-lbl {
        font-size: 0.85rem;
    }
}

/* Page Header & Search Bar */
.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
}

@media (min-width: 640px) {
    .admin-page-header {
        margin-bottom: 1.5rem;
        gap: 1rem;
    }
}

.admin-page-title {
    font-size: 1.35rem;
    margin-bottom: 2px;
    word-break: break-word;
}

@media (min-width: 640px) {
    .admin-page-title {
        font-size: 1.5rem;
    }
}

.admin-search-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

@media (min-width: 640px) {
    .admin-search-form {
        width: auto;
    }
}

.admin-search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    min-height: 40px;
}

@media (min-width: 640px) {
    .admin-search-form input[type="search"] {
        width: 220px;
        flex: none;
    }
}

/* Filter Pills Bar */
.admin-filter-bar {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

@media (min-width: 768px) {
    .admin-filter-bar {
        flex-wrap: wrap;
        overflow-x: visible;
        padding-bottom: 0;
        margin-bottom: 1.5rem;
        gap: 0.5rem;
    }
}

.admin-filter-bar .btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* Data Tables & Cards */
.table-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .table-card {
        border-radius: var(--radius-lg);
    }
}

.table-header-bar {
    padding: 1rem 0.85rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-width: 0;
}

@media (min-width: 640px) {
    .table-header-bar {
        padding: 1.25rem;
        align-items: center;
        gap: 1rem;
    }
}

.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.table th {
    background: #f8fafc;
    padding: 0.75rem 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

@media (min-width: 640px) {
    .table th {
        padding: 0.85rem 1rem;
    }
}

.table td {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    vertical-align: middle;
}

@media (min-width: 640px) {
    .table td {
        padding: 0.85rem 1rem;
    }
}

.table tbody tr:hover {
    background: #fdfdfd;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.785rem;
    font-weight: 700;
}

.status-pending {
    background: #fef3c7;
    color: #b45309;
}

.status-confirmed {
    background: #e0f2fe;
    color: #0369a1;
}

.status-processing {
    background: #f3e8ff;
    color: #7e22ce;
}

.status-delivered {
    background: #dcfce7;
    color: #15803d;
}

.status-cancelled {
    background: #fee2e2;
    color: #b91c1c;
}

/* Confirmation / Invoice Page */
.invoice-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 1.25rem 0.85rem;
    margin-block: 1rem;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

@media (min-width: 640px) {
    .invoice-card {
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-xl);
        padding: 2.25rem;
        margin-block: 2.5rem;
    }
}

.invoice-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-bottom: 2px dashed var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 640px) {
    .invoice-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        padding-bottom: 1.5rem;
        margin-bottom: 1.5rem;
        gap: 1rem;
    }
}

.invoice-code {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 800;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.invoice-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    margin-top: auto;
    padding-block: 2.5rem 2rem;
    color: var(--text-secondary);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
    }
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Print view */
@media print {
    body {
        background: #ffffff;
        color: #000000;
    }

    .site-header,
    .site-footer,
    .btn,
    .no-print,
    dialog.snack-lightbox,
    dialog.wa-modal-dialog,
    .wa-toast {
        display: none !important;
    }

    .invoice-card {
        box-shadow: none;
        border: none;
        padding: 0;
        margin: 0;
    }
}

/* Modal Lightbox for Snack 800x800px Preview (modern-web-guidance compliant) */
dialog.snack-lightbox {
    border: none;
    border-radius: var(--radius-xl);
    padding: 0;
    max-width: 740px;
    width: min(92vw, 740px);
    max-height: min(90vh, 560px);
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.06);
    position: fixed;
    inset: 0;
    margin: auto;
    overflow: hidden;
}

dialog.snack-lightbox:modal {
    overscroll-behavior: contain;
}

dialog.snack-lightbox::backdrop {
    background-color: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(6px);
    overflow: hidden;
    overscroll-behavior: contain;
}

dialog.snack-lightbox[open] {
    display: flex;
    flex-direction: column;
}

.lightbox-dialog-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: min(90vh, 560px);
    overflow: hidden;
    background: #ffffff;
}

.lightbox-close-form {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 30;
}

.lightbox-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    color: #1e293b;
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.lightbox-close-btn:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
    transform: scale(1.08);
}

.lightbox-media-box {
    position: relative;
    width: 100%;
    height: 220px;
    max-height: 35vh;
    background: #faf8f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lightbox-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lightbox-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.775rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
    letter-spacing: 0.03em;
}

.lightbox-content-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    overflow: hidden;
}

.lightbox-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.lightbox-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1c1917;
    line-height: 1.25;
    margin-top: 0.15rem;
}

.lightbox-price {
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--primary);
    white-space: nowrap;
}

.lightbox-desc {
    font-size: 0.925rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.lightbox-footer {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    background: #ffffff;
}

/* Tablet & Desktop Side-by-Side 2-Column Modal Layout */
@media (min-width: 640px) {
    dialog.snack-lightbox {
        max-width: 740px;
        width: min(92vw, 740px);
        max-height: min(85vh, 440px);
    }

    .lightbox-dialog-inner {
        display: grid;
        grid-template-columns: 320px 1fr;
        height: 100%;
        max-height: min(85vh, 440px);
    }

    .lightbox-media-box {
        height: 100%;
        max-height: 100%;
        min-height: 340px;
    }

    .lightbox-content-box {
        padding: 1.75rem;
        position: relative;
    }

    .lightbox-header {
        padding-right: 2.75rem; /* Room for close button */
    }

    .lightbox-title {
        font-size: 1.4rem;
    }

    .lightbox-desc {
        font-size: 0.95rem;
        line-height: 1.55;
    }

    .lightbox-footer {
        padding-top: 1rem;
    }
}

/* ==========================================================================
   WhatsApp Template System, Modal Dialog & Copy Feedback
   ========================================================================== */

/* Template items list */
.wa-template-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.wa-template-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: var(--transition);
}

.wa-template-item:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.wa-template-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wa-template-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.875rem;
    color: #1e293b;
    font-weight: 700;
}

.wa-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.725rem;
    font-weight: 700;
    line-height: 1.2;
}

.wa-badge-confirmed { background: #dcfce7; color: #15803d; }
.wa-badge-processing { background: #fef3c7; color: #b45309; }
.wa-badge-delivered { background: #e0f2fe; color: #0369a1; }

.wa-template-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    align-items: center;
}

.wa-header-wa-group {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 220px;
}

@media (max-width: 639px) {
    .wa-header-wa-group {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
    .wa-header-wa-group a.btn-success {
        grid-column: span 2;
        text-align: center;
        justify-content: center;
    }
    .wa-template-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .wa-template-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
    }
    .wa-template-actions a.btn-success {
        grid-column: span 2;
        text-align: center;
        justify-content: center;
    }
}

/* Extra Small Buttons */
.btn-xs {
    min-height: 30px;
    padding: 0.25rem 0.6rem;
    font-size: 0.775rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    line-height: 1.2;
}

.btn-copied {
    background: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}

/* Modal Dialog */
dialog.wa-modal-dialog {
    border: none;
    border-radius: var(--radius-xl);
    padding: 0;
    width: min(94vw, 680px);
    max-height: min(92vh, 760px);
    background: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.08);
    position: fixed;
    inset: 0;
    margin: auto;
    overflow: hidden;
    z-index: 9999;
}

dialog.wa-modal-dialog:not([open]) {
    display: none;
}

dialog.wa-modal-dialog::backdrop {
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(3px);
}

.wa-modal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: min(92vh, 760px);
}

.wa-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.wa-modal-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.wa-modal-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.wa-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.wa-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.wa-customer-pill {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.6rem 0.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.wa-modal-nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.25rem;
}

.wa-modal-tab-btn {
    background: transparent;
    border: none;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: var(--transition);
}

.wa-modal-tab-btn.active {
    color: #16a34a;
    border-bottom: 2px solid #16a34a;
    margin-bottom: -2px;
}

/* Chat bubble preview */
.wa-chat-preview {
    background: #e5ddd5;
    background-image: radial-gradient(#d1c7bc 1px, transparent 1px);
    background-size: 16px 16px;
    padding: 1rem;
    border-radius: var(--radius-md);
    min-height: 200px;
    max-height: 320px;
    overflow-y: auto;
}

.wa-chat-bubble {
    background: #ffffff;
    border-radius: 7.5px;
    padding: 0.75rem 0.85rem;
    max-width: 92%;
    box-shadow: 0 1px 1px rgba(0,0,0,0.12);
    font-size: 0.85rem;
    line-height: 1.5;
    color: #111b21;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
}

.wa-chat-bubble::after {
    content: "";
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 10px solid #ffffff;
    border-left: 10px solid transparent;
}

.wa-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    flex-wrap: wrap;
}

/* Toast message notification */
.wa-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: #ffffff;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.wa-toast.wa-toast-success {
    background: #15803d;
}