﻿/* ============================================
   RAYAL EVENTS - Customization Pages Styles
   ============================================ */
:root {
    --primary: #0a0a0a;
    --secondary: #1a1a1a;
    --accent: #d4af37;
    --accent-light: #f1d483;
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.05);
}

/* Light Theme Support for Customize Pages */
:root.light-theme,
body.light-theme {
    --primary: #ffffff;
    --secondary: #f8f9fa;
    --accent: #5a3a0d;
    --accent-light: #704214;
    --text: #1a237e;
    --text-dim: #283593;
    --border: rgba(90, 58, 13, 0.3);
    --glass: rgba(90, 58, 13, 0.05);
}

.light-theme .customize-container {
    background: #ffffff;
    color: #1a237e;
}

.light-theme .sidebar {
    background: #f8f9fa;
    border-right-color: rgba(90, 58, 13, 0.3);
}

.light-theme .brand-name {
    color: #5a3a0d;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.light-theme .brand-tagline {
    color: #495057;
    font-weight: 700;
}

.light-theme .cat-btn {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(139, 105, 20, 0.3);
    color: #495057;
    font-weight: 600;
}

.light-theme .cat-btn:hover,
.light-theme .cat-btn.active {
    background: linear-gradient(135deg, #5a3a0d, #704214, #8B6914) !important;
    color: #ffffff !important;
    border-color: #5a3a0d !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 12px rgba(90,58,13,0.4), 0 2px 8px rgba(90,58,13,0.2);
}

.light-theme .main-content {
    background: #ffffff;
}

.light-theme .section-title {
    color: #5a3a0d;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.light-theme .section-subtitle {
    color: #283593;
    font-weight: 600;
}

.light-theme .item-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(90, 58, 13, 0.3);
    color: #1a237e;
}

.light-theme .item-card:hover {
    border-color: #5a3a0d;
    background: rgba(90, 58, 13, 0.08);
    box-shadow: 0 4px 15px rgba(90, 58, 13, 0.25);
}

.light-theme .item-card.selected {
    border-color: #5a3a0d;
    background: rgba(90, 58, 13, 0.15);
    box-shadow: 0 0 0 2px #5a3a0d;
}

.light-theme .item-tag {
    color: #5a3a0d;
    font-weight: 900;
}

.light-theme .item-name {
    color: #1a237e;
    font-weight: 800;
}

.light-theme .package-contents {
    color: #283593;
    font-weight: 600;
}

.light-theme .package-contents li::before {
    color: #5a3a0d;
}

.light-theme .selection-panel {
    background: #f8f9fa;
    border-left-color: rgba(90, 58, 13, 0.3);
}

.light-theme .panel-title {
    color: #1a237e;
    font-weight: 900;
}

.light-theme .selected-item {
    background: rgba(90, 58, 13, 0.1);
    border-color: rgba(90, 58, 13, 0.4);
    color: #1a237e;
    font-weight: 700;
}

.light-theme .wish-label {
    color: #5a3a0d;
    font-weight: 900;
}

.light-theme .wish-textarea {
    background: #ffffff;
    border-color: rgba(90, 58, 13, 0.4);
    color: #283593;
    font-weight: 600;
}

.light-theme .wish-textarea::placeholder {
    color: #6c757d;
    opacity: 0.8;
}

.light-theme .wish-textarea:focus {
    border-color: #5a3a0d;
    box-shadow: 0 0 0 3px rgba(90, 58, 13, 0.2);
}

.light-theme .continue-btn {
    background: linear-gradient(135deg, #5a3a0d, #704214);
    color: #ffffff;
    font-weight: 900;
}

.light-theme .continue-btn:hover {
    background: linear-gradient(135deg, #3d2709, #5a3a0d);
    box-shadow: 0 10px 20px rgba(90, 58, 13, 0.4);
}

.light-theme .empty-msg {
    color: #6c757d;
    font-weight: 600;
}

.light-theme .type-btn {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(90, 58, 13, 0.3) !important;
    color: #495057 !important;
    font-weight: 700 !important;
}

.light-theme .type-btn.active {
    background: linear-gradient(135deg, #5a3a0d, #704214) !important;
    color: #ffffff !important;
    border-color: #5a3a0d !important;
    font-weight: 900 !important;
    box-shadow: 0 4px 12px rgba(90,58,13,0.4) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--primary);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    overflow: hidden; /* Main content scrolls individual columns */
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
}

.customize-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* --- SIDEBAR (Categories) --- */
.sidebar {
    width: 250px;
    background: var(--secondary);
    border-right: 1px solid var(--border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.logo-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.brand-text {
    line-height: 1.2;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent);
}

.brand-tagline {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: var(--text-dim);
}

.cat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cat-btn {
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 12px 15px;
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
}

.cat-btn:hover, .cat-btn.active {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
    transform: translateX(5px);
}

/* --- MAIN CONTENT (Menus/Items) --- */
.main-content {
    flex: 1;
    background: var(--primary);
    padding: 40px;
    overflow-y: auto;
}

.section-header {
    margin-bottom: 30px;
}

.section-title {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.items-grid {
    display: grid;
    /* columns controlled by JS per mode: 2-col for standard, 3-col for customize */
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .items-grid { grid-template-columns: 1fr !important; }
}
@media (max-width: 600px) {
    .items-grid { grid-template-columns: 1fr !important; }
}

.item-card {
    background: var(--glass);
    border: 1.5px solid var(--border);
    padding: 20px;
    border-radius: 18px;
    transition: 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.item-card .preview-trigger {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.item-card .preview-trigger:hover {
    transform: scale(1.06);
}

.item-card .preview-trigger svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.preview-image-shell {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.preview-image-shell img {
    width: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.28s ease, filter 0.28s ease;
}

.preview-image-shell:hover img {
    transform: scale(1.06);
    filter: saturate(1.04) contrast(1.03);
}

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(10px);
}

.preview-modal.open {
    display: flex;
}

.preview-modal-card {
    width: min(1100px, 96vw);
    max-height: 92vh;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(18,18,18,0.98), rgba(10,10,10,0.98));
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

.preview-modal-media {
    width: 100%;
    max-height: calc(92vh - 130px);
    background: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-modal-media img {
    width: 100%;
    height: 100%;
    max-height: calc(92vh - 130px);
    object-fit: contain;
    display: block;
}

.preview-modal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    color: #fff;
}

.preview-modal-title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
}

.preview-modal-subtitle {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

.preview-modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

/* A-Z package gallery popup */
.atoz-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.95);
}

.atoz-gallery-modal-card {
    position: relative;
    width: min(920px, 100%);
    max-height: min(92vh, 920px);
    padding: 24px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(26,26,26,0.98), rgba(16,16,16,0.98));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.atoz-gallery-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.95);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    z-index: 2;
}

.atoz-gallery-modal-card > h2 {
    padding-right: 56px;
    margin-bottom: 16px;
    color: #fff;
}

.atoz-gallery-modal-card > h2 {
    font-size: 1.4rem;
    line-height: 1.2;
    margin: 0;
}

.atoz-gallery-modal-card > h2 + div {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
}

.atoz-gallery-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    max-height: calc(92vh - 126px);
    overflow-y: auto !important;
    padding-right: 4px;
}

.atoz-gallery-list::-webkit-scrollbar {
    width: 6px;
}

.atoz-gallery-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.35);
    border-radius: 999px;
}

.atoz-gallery-item {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: #111;
    flex: 0 0 auto;
}

.atoz-gallery-item img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

.atoz-gallery-item-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 14px;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
}

@media (max-width: 768px) {
    .atoz-gallery-modal {
        padding: 10px;
        align-items: stretch;
    }

    .atoz-gallery-modal-card {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 18px 14px 14px;
        border-radius: 16px;
    }

    .atoz-gallery-header h2 {
        font-size: 1.1rem;
    }

    .atoz-gallery-list {
        max-height: calc(100vh - 100px);
    }
}

@media (hover: none) and (pointer: coarse) {
    .item-card:hover .preview-image-shell img {
        transform: none;
    }
}

.item-card:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb, 212, 175, 55), 0.05);
    box-shadow: 0 4px 15px rgba(var(--accent-rgb, 212, 175, 55), 0.15);
}

.item-card.selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb, 212, 175, 55), 0.12);
    box-shadow: 0 0 0 2px var(--accent);
}

.item-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.item-name {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.package-contents {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
    list-style: none;
}

.package-contents li::before {
    content: "•";
    color: var(--accent);
    margin-right: 8px;
}

/* --- SELECTION PANEL (Preview) --- */
.selection-panel {
    width: 350px;
    background: var(--secondary);
    border-left: 1px solid var(--border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-title {
    font-size: 1.3rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-list {
    flex: 1;
    margin-bottom: 30px;
}

.selected-item {
    background: rgba(0,0,0,0.2);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.remove-item {
    color: #ef4444;
    cursor: pointer;
    padding: 5px;
}

.wish-container {
    margin-bottom: 20px;
}

.wish-label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 8px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.wish-textarea {
    width: 100%;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 12px;
    font-family: inherit;
    resize: none;
    font-size: 0.85rem;
}

.wish-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.continue-btn {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.continue-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.empty-msg {
    color: var(--text-dim);
    text-align: center;
    padding: 40px 0;
    font-size: 0.85rem;
}

.type-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-modal-media img {
    width: 100%;
    height: 100%;
    max-height: calc(92vh - 130px);
    object-fit: contain;
    display: block;
}

.preview-modal-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    color: #fff;
}

.preview-modal-title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
}

.preview-modal-subtitle {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

.preview-modal-close {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
}

@media (hover: none) and (pointer: coarse) {
    .item-card:hover .preview-image-shell img {
        transform: none;
    }
}

.item-card:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb, 212, 175, 55), 0.05);
    box-shadow: 0 4px 15px rgba(var(--accent-rgb, 212, 175, 55), 0.15);
}

.item-card.selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb, 212, 175, 55), 0.12);
    box-shadow: 0 0 0 2px var(--accent);
}

.item-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
}

.item-name {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.package-contents {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.6;
    list-style: none;
}

.package-contents li::before {
    content: "•";
    color: var(--accent);
    margin-right: 8px;
}

/* --- SELECTION PANEL (Preview) --- */
.selection-panel {
    width: 350px;
    background: var(--secondary);
    border-left: 1px solid var(--border);
    padding: 30px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel-title {
    font-size: 1.3rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.selected-list {
    flex: 1;
    margin-bottom: 30px;
}

.selected-item {
    background: rgba(0,0,0,0.2);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    font-size: 0.85rem;
}

.remove-item {
    color: #ef4444;
    cursor: pointer;
    padding: 5px;
}

.wish-container {
    margin-bottom: 20px;
}

.wish-label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 8px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.wish-textarea {
    width: 100%;
    background: var(--primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 12px;
    font-family: inherit;
    resize: none;
    font-size: 0.85rem;
}

.wish-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.continue-btn {
    background: var(--accent);
    color: var(--primary);
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.continue-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
}

.empty-msg {
    color: var(--text-dim);
    text-align: center;
    padding: 40px 0;
    font-size: 0.85rem;
}

.type-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.type-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-dim);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.type-btn.active {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
}

/* Mode and Diet Buttons Row Container - All 4 buttons in single line */
.mode-buttons-container {
    display: flex;
    gap: 8px;
    width: 100%;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    min-width: 350px;
}

/* Base style for type-btn inside container */
.mode-buttons-container .type-btn {
    flex: 1 1 auto;
    padding: 10px 4px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-dim);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mode-buttons-container .type-btn.active {
    background: var(--accent);
    color: var(--primary);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(198, 149, 43, 0.2);
}

/* Specialize Veg / Non-Veg active backgrounds slightly if desired, or keep accent */
.mode-buttons-container #btn-veg.active {
    background: #22c55e !important;
    color: #fff !important;
    border-color: #22c55e !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3) !important;
}

.mode-buttons-container #btn-nonveg.active {
    background: #ef4444 !important;
    color: #fff !important;
    border-color: #ef4444 !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
}

/* RESPONSIVE */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Tablet layout: stack columns */
    .customize-container {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }
    .sidebar, .main-content, .selection-panel {
        width: 100%;
        height: auto;
        border: none;
    }
    .sidebar {
        padding: 20px;
    }
}

/* Desktop: categories vertical scroll in sidebar */
@media (min-width: 769px) {
    .sidebar {
        overflow-y: auto !important;
    }

    /* Desktop: Mode and Diet Buttons Layout - Single line flex */
    .mode-buttons-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
        align-items: stretch !important;
        min-width: 350px !important;
    }

    .mode-buttons-container .type-btn {
        flex: 1 1 auto !important;
        padding: 6px 6px !important;
        border: 1px solid var(--border) !important;
        background: var(--glass) !important;
        color: var(--text-dim) !important;
        border-radius: 8px !important;
        cursor: pointer !important;
        font-size: 0.8rem !important;
        font-weight: 700 !important;
        transition: all 0.3s !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-height: 32px !important;
    }

    .mode-buttons-container .type-btn.active {
        background: var(--accent) !important;
        color: var(--primary) !important;
        border-color: var(--accent) !important;
        box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2) !important;
    }

    /* Veg/Non-Veg buttons styling (diet buttons) */
    .mode-buttons-container #btn-veg.active {
        background: #22c55e !important;
        color: #fff !important;
        border-color: #22c55e !important;
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3) !important;
    }

    .mode-buttons-container #btn-nonveg.active {
        background: #ef4444 !important;
        color: #fff !important;
        border-color: #ef4444 !important;
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3) !important;
    }

    .cat-list-wrap {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        flex: 1 !important;
    }
    .cat-list-wrap::-webkit-scrollbar {
        width: 6px;
    }
    .cat-list-wrap::-webkit-scrollbar-track {
        background: transparent;
        margin: 5px 0;
    }
    .cat-list-wrap::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 3px;
    }
    .cat-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .cat-list .cat-btn {
        width: 100% !important;
        min-width: unset !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 52px !important;
        font-size: 0.9rem !important;
        padding: 12px 16px !important;
        line-height: 1.4 !important;
        white-space: normal !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    .cat-list .cat-btn .cat-count {
        font-size: 0.7rem !important;
    }

    /* Desktop: Translate buttons beside section title */
    .translate-bar {
        display: flex !important;
        gap: 8px !important;
    }

    .translate-buttons-mobile {
        display: none !important;
    }

    .section-header {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 20px !important;
    }

    .section-header > div:first-child {
        flex: 1 !important;
    }

    /* Desktop translate buttons (custom styling) */
    .section-header::after {
        content: '';
        display: flex;
        flex-direction: column;
        gap: 8px;
        flex-shrink: 0;
    }

    /* Position translate buttons on the right */
    .translate-buttons-desktop {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }

    /* DECOR CUSTOMIZE PAGE - DESKTOP ONLY */
    /* 1. Place section header and WhatsApp info bar on same line */
    .section-header {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 16px !important;
        flex-wrap: wrap !important;
        margin-bottom: 20px !important;
    }

    .section-header > div:first-child {
        flex: 0 1 auto !important;
        min-width: 300px !important;
    }

    .section-header h2 {
        font-size: 1.6rem !important;
        margin-bottom: 8px !important;
    }

    .section-header p {
        font-size: 0.8rem !important;
        margin-bottom: 0 !important;
    }

    /* 2. Style WhatsApp button in selection-panel properly */
    .whatsapp-btn {
        width: 100% !important;
        padding: 12px 16px !important;
        background: linear-gradient(135deg, #25D366, #1fa854) !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 10px !important;
        font-size: 0.9rem !important;
        font-weight: 700 !important;
        cursor: pointer !important;
        transition: all 0.3s !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        margin-bottom: 12px !important;
    }

    .whatsapp-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, #22c55e, #16a34a) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 16px rgba(34, 197, 94, 0.3) !important;
    }

    .whatsapp-btn:disabled {
        background: rgba(34, 197, 94, 0.4) !important;
        cursor: not-allowed !important;
        opacity: 0.6 !important;
    }

    .whatsapp-btn svg {
        width: 20px !important;
        height: 20px !important;
    }
}

/* ============================================
   MOBILE FIXES (≤768px) — scroll + layout
   ============================================ */
@media (max-width: 768px) {

    /* Fix: allow the page to scroll on mobile */
    body {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
    }

    .customize-container {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
        overflow: visible !important;
    }

    /* Sidebar: horizontal scrolling category pills */
    .sidebar {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 16px !important;
        flex-direction: column !important;
    }

    .brand-container {
        margin-bottom: 16px !important;
    }

    /* Mode buttons container on mobile - Single line flex */
    .mode-buttons-container {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        margin-bottom: 16px !important;
        width: 100% !important;
        align-items: stretch !important;
        min-width: 350px !important;
    }
    
    .mode-buttons-container::-webkit-scrollbar {
        display: none;
    }
    
    .mode-buttons-container .type-btn {
        flex: 1 1 auto !important;
        padding: 8px 10px !important;
        font-size: 0.72rem !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Category list: horizontal scroll row */
    .cat-list-wrap {
        overflow-x: auto !important;
        overflow-y: visible !important;
        flex: none !important;
        width: 100% !important;
    }

    .cat-list {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        width: max-content !important;
    }

    .cat-btn {
        white-space: normal !important;
        padding: 6px 10px !important;
        font-size: 0.65rem !important;
        text-align: center !important;
        width: 65px !important;
        height: 40px !important;
        min-width: 65px !important;
        min-height: 40px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        line-height: 1 !important;
        word-break: break-word !important;
        overflow: hidden !important;
        border-radius: 4px !important;
    }

    /* Main content: full width, natural height */
    .main-content {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 16px !important;
        flex-direction: column !important;
    }

    /* Items grid wrap: scrollable with fixed height, allows page scroll after end */
    .items-grid-wrap {
        flex: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: auto !important;
        max-height: 40vh !important;
        margin-bottom: 16px !important;
    }

    /* Items grid: 2 columns on mobile */
    .items-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .item-card {
        padding: 12px !important;
        background: rgba(0, 0, 0, 0.3) !important;
        border: 1.5px solid rgba(212, 175, 55, 0.2) !important;
        color: #ffffff !important;
    }

    .item-card .item-name,
    .item-card .item-tag,
    .item-card .package-contents {
        color: #ffffff !important;
    }

    .item-card.selected {
        background: rgba(212, 175, 55, 0.15) !important;
        border-color: #d4af37 !important;
        box-shadow: 0 0 0 2px #d4af37 !important;
    }

    .light-theme .item-card {
        background: rgba(255, 255, 255, 0.95) !important;
        border-color: rgba(90, 58, 13, 0.3) !important;
        color: #1a237e !important;
    }

    .light-theme .item-card .item-name,
    .light-theme .item-card .item-tag,
    .light-theme .item-card .package-contents {
        color: #1a237e !important;
    }

    .light-theme .item-card.selected {
        background: rgba(90, 58, 13, 0.15) !important;
        border-color: #5a3a0d !important;
        box-shadow: 0 0 0 2px #5a3a0d !important;
    }

    .item-name {
        font-size: 0.9rem !important;
    }

    .package-contents {
        font-size: 0.78rem !important;
    }

    .section-title {
        font-size: 1.4rem !important;
    }

    .section-subtitle {
        font-size: 0.8rem !important;
    }

    /* Translate bar */
    .translate-bar {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 8px 10px !important;
        margin-bottom: 12px !important;
    }

    /* Type switcher (Standard/Customize tabs) */
    .type-switcher {
        gap: 8px !important;
        margin-bottom: 16px !important;
    }

    .type-btn {
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
    }

    /* Selection panel: full width below */
    .selection-panel {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 16px !important;
        border-left: none !important;
        border-top: 1px solid var(--border) !important;
    }

    .panel-title {
        font-size: 1.1rem !important;
        margin-bottom: 16px !important;
    }

    .selected-list {
        flex: none !important;
        margin-bottom: 16px !important;
    }

    .continue-btn {
        padding: 12px !important;
        font-size: 0.9rem !important;
    }

    .wish-textarea {
        font-size: 0.82rem !important;
    }

    /* === MOBILE LAYOUT FIXES === */

    /* 1. Back button beside mode buttons */
    .back-wrap {
        display: none !important;
    }

    .back-btn-mobile {
        display: inline-flex !important;
        margin-left: auto !important;
        flex: 0 1 auto !important;
    }

    .mode-buttons-container {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    .mode-buttons-container .type-btn {
        flex: 1 1 auto !important;
        min-width: 70px !important;
        padding: 6px 8px !important;
        font-size: 0.65rem !important;
    }

    .mode-buttons-container .back-btn-mobile {
        flex: 1 1 auto !important;
        min-width: 60px !important;
        padding: 6px 8px !important;
        font-size: 0.65rem !important;
    }

    /* 2. Equal size category buttons (Chinese Ball Style) - HORIZONTAL SCROLL */
    .cat-list {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        width: 100% !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .cat-list::-webkit-scrollbar {
        display: none;
    }

    .cat-btn {
        white-space: normal !important;
        padding: 6px 10px !important;
        font-size: 0.65rem !important;
        text-align: center !important;
        width: 180px !important;
        height: 36px !important;
        min-width: 70px !important;
        max-width: 180px !important;
        min-height: 36px !important;
        max-height: 48px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        line-height: 1 !important;
        word-break: break-word !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        border-radius: 4px !important;
    }

    .cat-btn .cat-count {
        font-size: 0.55rem !important;
        margin-top: 2px !important;
        display: block !important;
    }

    /* 3. Remove Translate text, move buttons beside section title */
    .translate-bar {
        display: none !important;
    }

    .section-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
        flex-wrap: wrap !important;
    }

    .section-header > div:first-child {
        flex: 1 1 auto !important;
    }

    .translate-buttons-mobile {
        display: flex !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
    }

    
    /* 4. Fixed header & categories, scrollable menus */
    .sidebar {
        overflow-y: auto !important;
    }

    .main-content {
        display: grid !important;
        grid-template-rows: auto auto 1fr !important;
        gap: 0 !important;
    }

    .section-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
        background: var(--primary) !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid var(--border) !important;
    }

    .cat-list-wrap {
        position: sticky !important;
        top: auto !important;
        z-index: 9 !important;
        background: var(--primary) !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid var(--border) !important;
    }

    .items-grid-wrap {
        overflow-y: auto !important;
        overflow-x: hidden !important;
        max-height: 40vh !important;
        margin-bottom: 16px !important;
    }

    /* Ensure proper scrolling behavior - page scrolls naturally */
    .customize-container {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto auto !important;
        height: auto !important;
    }

    .sidebar {
        grid-column: 1 !important;
        grid-row: 1 !important;
    }

    .main-content {
        grid-column: 1 !important;
        grid-row: 2 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        padding: 16px !important;
    }

    .selection-panel {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }

    /* ============================================
       MOBILE STALLS CUSTOMIZE - HEADER & BUTTONS
       ============================================ */
    
    /* Show existing desktop buttons on mobile with stalls theme styling */
    .translate-buttons-desktop {
        display: flex !important;
        gap: 8px !important;
        position: absolute !important;
        top: 16px !important;
        right: 16px !important;
        flex-direction: row !important;
        z-index: 20 !important;
    }

    /* Move back button to top right corner on mobile */
    .back-wrap {
        display: none !important;
    }

    /* Compact back button next to brand text */
    .back-btn-compact {
        margin-left: auto;
        padding: 6px 12px;
        background: rgba(198, 149, 43, 0.1);
        border: 1.5px solid rgba(198, 149, 43, 0.4);
        border-radius: 6px;
        color: #c6952b;
        font-size: 0.8rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.3s ease;
        white-space: nowrap;
        font-family: inherit;
    }

    .back-btn-compact:hover {
        background: #c6952b;
        color: #000;
        border-color: #c6952b;
    }
}

/* Show back button on desktop for caterer customize page */
body[data-page="caterer-customize"] .back-wrap {
    display: flex !important;
}

/* Desktop: Reset back button to sidebar, hide language buttons from header */
@media (min-width: 769px) {
    .translate-buttons-desktop {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        position: static !important;
        top: auto !important;
        right: auto !important;
    }

    .back-wrap {
        position: static !important;
        top: auto !important;
        right: auto !important;
        z-index: auto !important;
        width: 100% !important;
        display: block !important;
    }

    .back-wrap .cat-btn {
        width: 100% !important;
        height: auto !important;
        min-width: unset !important;
        min-height: unset !important;
        padding: 12px 15px !important;
        font-size: 0.9rem !important;
        border: 1px solid var(--border) !important;
        background: var(--glass) !important;
        border-radius: 10px !important;
    }

    .back-wrap .cat-btn:hover,
    .back-wrap .cat-btn.active {
        background: var(--accent) !important;
        border-color: var(--accent) !important;
        box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2) !important;
    }
}
