/* ==========================================================================
   Mohiva Hamper Builder - Stylesheet
   Theme: Luxury Gifting (Warm Gold, Rose, Deep Espresso, Cream)
   Layout: Fully Responsive (Desktop Sticky Column + Mobile Slide-Up Bottom Sheet)
   ========================================================================== */

:root {
    --mh-gold: #c59b63;
    --mh-gold-dark: #ad834c;
    --mh-gold-light: #fbf5ed;
    --mh-espresso: #241613;
    --mh-rose: #d97d88;
    --mh-rose-light: #fdf2f4;
    --mh-bg: #faf7f2;
    --mh-surface: #ffffff;
    --mh-border: #ebdcd2;
    --mh-border-light: #f4ede6;
    --mh-text: #221e1c;
    --mh-text-muted: #746d67;
    --mh-success: #2e7d32;
    --mh-success-light: #eef7ee;
    --mh-shadow-sm: 0 2px 8px rgba(36, 22, 19, 0.05);
    --mh-shadow-md: 0 8px 24px rgba(36, 22, 19, 0.08);
    --mh-shadow-lg: 0 16px 40px rgba(36, 22, 19, 0.16);
    --mh-radius: 14px;
}

.mohiva-hamper-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: inherit;
    color: var(--mh-text);
}

/* Header */
.mohiva-hamper-header {
    text-align: center;
    padding: 20px 16px 12px;
    max-width: 760px;
    margin: 0 auto;
}

.mohiva-hamper-header .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--mh-gold-light);
    color: var(--mh-gold-dark);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.mohiva-hamper-header h2 {
    font-size: 28px;
    color: var(--mh-espresso);
    margin: 0 0 6px;
    font-weight: 700;
    line-height: 1.25;
}

.mohiva-hamper-header p {
    font-size: 14px;
    color: var(--mh-text-muted);
    margin: 0 auto;
    line-height: 1.45;
}

@media (min-width: 768px) {
    .mohiva-hamper-header {
        padding: 26px 20px 16px;
    }
    .mohiva-hamper-header h2 {
        font-size: 36px;
    }
    .mohiva-hamper-header p {
        font-size: 15.5px;
    }
}

/* Main Grid Layout */
.mohiva-builder-grid {
    display: grid;
    grid-template-columns: 1fr 390px;
    gap: 28px;
    align-items: start;
}

@media (max-width: 1024px) {
    .mohiva-builder-grid {
        grid-template-columns: 1fr;
        padding-bottom: 70px;
    }
}

/* Category Filter Bar */
.mohiva-category-nav-wrapper {
    position: sticky;
    top: 10px;
    z-index: 90;
    background: var(--mh-bg);
    padding: 8px 0 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--mh-border-light);
}

/* Mobile Dropdown Row */
.mohiva-mobile-cat-dropdown-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mohiva-mobile-cat-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--mh-text-muted);
    white-space: nowrap;
}

.mohiva-mobile-category-dropdown {
    width: 100%;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid var(--mh-border);
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    color: var(--mh-espresso);
    outline: none;
    box-shadow: var(--mh-shadow-sm);
}

/* Category Nav Container with Scroll Arrows */
.mohiva-category-nav-container {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.mohiva-nav-arrow-btn {
    width: 28px;
    height: 32px;
    background: #ffffff;
    border: 1px solid var(--mh-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: var(--mh-espresso);
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: var(--mh-shadow-sm);
    transition: all 0.2s ease;
}

.mohiva-nav-arrow-btn:hover {
    background: var(--mh-gold-light);
    border-color: var(--mh-gold);
    color: var(--mh-gold-dark);
}

.mohiva-btn-open-cat-menu {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid var(--mh-border);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--mh-gold-dark);
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    box-shadow: var(--mh-shadow-sm);
}

.mohiva-btn-open-cat-menu:hover {
    background: var(--mh-gold-light);
    border-color: var(--mh-gold);
}

.mohiva-category-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
    padding: 2px 2px 4px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    flex-grow: 1;
}

.mohiva-category-nav::-webkit-scrollbar {
    height: 4px;
}

.mohiva-category-nav::-webkit-scrollbar-thumb {
    background: #d8cec4;
    border-radius: 10px;
}

.category-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    background: #ffffff;
    border: 1px solid var(--mh-border);
    border-radius: 24px;
    color: var(--mh-text);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.category-tab-btn:hover {
    border-color: var(--mh-gold);
    color: var(--mh-gold-dark);
}

.category-tab-btn.active {
    background: var(--mh-espresso);
    color: #ffffff;
    border-color: var(--mh-espresso);
    box-shadow: 0 3px 10px rgba(36, 22, 19, 0.18);
}

.category-tab-btn .chip-count {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 700;
}

.category-tab-btn.active .chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* Category Next/Prev Buttons Row */
.mohiva-category-pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--mh-border-light);
}

.mohiva-btn-cat-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1px solid var(--mh-border);
    border-radius: 10px;
    color: var(--mh-espresso);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mohiva-btn-cat-nav:hover {
    border-color: var(--mh-gold);
    color: var(--mh-gold-dark);
}

.mohiva-btn-cat-nav.next {
    margin-left: auto;
    background: var(--mh-gold-light);
    border-color: var(--mh-gold);
    color: var(--mh-gold-dark);
    font-weight: 700;
}

.mohiva-btn-cat-nav.next:hover {
    background: var(--mh-gold);
    color: #ffffff;
}

/* 9 Categories Quick Grid Modal */
.mohiva-cat-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(36, 22, 19, 0.65);
    backdrop-filter: blur(3px);
    z-index: 950;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mohiva-cat-modal-overlay.active {
    display: flex;
}

.mohiva-cat-modal-card {
    background: #ffffff;
    border-radius: 20px;
    max-width: 520px;
    width: 100%;
    padding: 22px;
    box-shadow: var(--mh-shadow-lg);
    animation: popIn 0.25s ease;
}

.mohiva-cat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--mh-border-light);
    padding-bottom: 12px;
}

.mohiva-cat-modal-header h3 {
    font-size: 20px;
    color: var(--mh-espresso);
    margin: 0;
}

.mohiva-cat-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mohiva-cat-modal-item {
    background: var(--mh-bg);
    border: 1px solid var(--mh-border);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mohiva-cat-modal-item:hover,
.mohiva-cat-modal-item.active {
    background: var(--mh-gold-light);
    border-color: var(--mh-gold);
    transform: translateY(-2px);
}

.mohiva-cat-modal-item .cat-modal-icon {
    font-size: 24px;
}

.mohiva-cat-modal-item .cat-modal-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--mh-espresso);
    line-height: 1.2;
}

.mohiva-cat-modal-item .cat-modal-count {
    font-size: 10.5px;
    color: var(--mh-rose);
    font-weight: 700;
}

/* Category Panels */
.category-panel {
    display: none;
    animation: fadeIn 0.25s ease;
}

.category-panel.active {
    display: block;
}

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

.category-banner {
    background: #ffffff;
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    padding: 14px 18px;
    margin-bottom: 16px;
}

.category-banner h3 {
    margin: 0 0 3px;
    font-size: 19px;
    color: var(--mh-espresso);
}

.category-banner p {
    margin: 0;
    font-size: 13px;
    color: var(--mh-text-muted);
}

/* Products Subgrid: 2-columns on mobile, 3-4 on desktop */
.products-subgrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .products-subgrid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1025px) {
    .products-subgrid {
        grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
        gap: 18px;
    }
}

.hamper-product-card {
    background: #ffffff;
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.hamper-product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--mh-shadow-md);
    border-color: var(--mh-gold);
}

.hamper-product-card.in-hamper {
    border-color: var(--mh-gold);
    background: #fffdfa;
    box-shadow: 0 0 0 1px var(--mh-gold);
}

.card-image-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(135deg, #fdfaf6, #f7f1e9);
    position: relative;
    overflow: hidden;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.in-hamper-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--mh-gold);
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.card-details {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

@media (min-width: 768px) {
    .card-details {
        padding: 14px;
    }
}

.card-details h4 {
    font-size: 13px;
    margin: 0 0 4px;
    font-weight: 600;
    color: var(--mh-espresso);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 34px;
}

@media (min-width: 768px) {
    .card-details h4 {
        font-size: 14.5px;
        height: 38px;
        margin-bottom: 6px;
    }
}

.card-price {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--mh-gold-dark);
    margin-bottom: 10px;
}

@media (min-width: 768px) {
    .card-price {
        font-size: 16px;
        margin-bottom: 12px;
    }
}

.card-action-wrap {
    margin-top: auto;
}

.btn-add-item {
    width: 100%;
    padding: 8px 6px;
    background: var(--mh-gold-light);
    border: 1px solid var(--mh-gold);
    color: var(--mh-gold-dark);
    border-radius: 8px;
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

@media (min-width: 768px) {
    .btn-add-item {
        padding: 9px;
        font-size: 13.5px;
    }
}

.btn-add-item:hover {
    background: var(--mh-gold);
    color: #ffffff;
}

/* Stepper inside card */
.card-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid var(--mh-gold);
    border-radius: 8px;
    padding: 2px 4px;
}

.card-stepper button {
    width: 28px;
    height: 26px;
    border: none;
    background: var(--mh-gold-light);
    color: var(--mh-gold-dark);
    font-size: 15px;
    font-weight: 800;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.card-stepper button:hover {
    background: var(--mh-gold);
    color: #fff;
}

.card-stepper span {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--mh-espresso);
}

/* ==========================================================================
   DRAWER / BOTTOM SHEET STYLING
   ========================================================================== */

.mohiva-drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(36, 22, 19, 0.6);
    backdrop-filter: blur(3px);
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mohiva-drawer-backdrop.active {
    display: block;
    opacity: 1;
}

/* Desktop Sidebar View (>= 1025px) */
@media (min-width: 1025px) {
    .mohiva-drawer-section {
        position: sticky;
        top: 72px;
        max-height: calc(100vh - 86px);
        display: flex;
        flex-direction: column;
        z-index: 100;
    }

    .hamper-box-card {
        background: #ffffff;
        border: 1px solid var(--mh-border);
        border-radius: 18px;
        box-shadow: var(--mh-shadow-md);
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 86px);
        overflow: hidden;
    }

    .drawer-drag-handle,
    .btn-close-drawer {
        display: none !important;
    }
}

/* Mobile / Tablet Bottom Sheet View (< 1025px) */
@media (max-width: 1024px) {
    .mohiva-drawer-section {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 600;
        transform: translateY(100%);
        transition: transform 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.15);
        max-height: 88vh;
        display: flex;
        flex-direction: column;
    }

    .mohiva-drawer-section.open {
        transform: translateY(0);
    }

    .hamper-box-card {
        background: #ffffff;
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: column;
        max-height: 88vh;
        overflow: hidden;
    }

    .drawer-drag-handle {
        width: 44px;
        height: 5px;
        background: #ddd;
        border-radius: 10px;
        margin: 8px auto 4px;
        cursor: pointer;
    }

    .btn-close-drawer {
        background: #f0ebe4;
        border: none;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        font-size: 15px;
        font-weight: 700;
        color: var(--mh-espresso);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Drawer Header & Integrated Progress */
.box-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--mh-border-light);
    background: #ffffff;
    flex-shrink: 0;
}

.box-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.box-header-top h3 {
    margin: 0;
    font-size: 19px;
    color: var(--mh-espresso);
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-count-badge {
    background: var(--mh-rose-light);
    color: var(--mh-rose);
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
}

.progress-block {
    background: var(--mh-bg);
    border: 1px solid var(--mh-border-light);
    border-radius: 10px;
    padding: 9px 12px;
}

.progress-text-row {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 600;
    margin-bottom: 5px;
}

.progress-meter-bar {
    width: 100%;
    height: 7px;
    background: #e9e1d8;
    border-radius: 10px;
    overflow: hidden;
}

.progress-meter-fill {
    height: 100%;
    background: linear-gradient(90deg, #c59b63, #e67e22, #28a745);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-status-msg {
    font-size: 11px;
    font-weight: 600;
    margin-top: 5px;
    display: block;
    color: #d32f2f;
}

.progress-status-msg.unlocked {
    color: var(--mh-success);
}

/* Scrollable Body */
.box-scrollable-body {
    padding: 14px 18px;
    overflow-y: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.box-style-selector {
    margin-bottom: 12px;
}

.box-style-selector label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--mh-text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mohiva-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--mh-border);
    background: #fffdfb;
    font-size: 13px;
    color: var(--mh-text);
}

/* Items List */
.hamper-items-list {
    margin-bottom: 12px;
}

.empty-hamper-state {
    text-align: center;
    padding: 20px 10px;
    color: var(--mh-text-muted);
    background: var(--mh-bg);
    border-radius: 10px;
    border: 1px dashed var(--mh-border);
}

.empty-icon {
    font-size: 30px;
    display: block;
    margin-bottom: 3px;
}

.empty-hamper-state p {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px;
}

.empty-hamper-state small {
    font-size: 11.5px;
}

.hamper-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--mh-border);
}

.hamper-item-row img {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

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

.hamper-item-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hamper-item-price {
    font-size: 12px;
    color: var(--mh-gold-dark);
    font-weight: 700;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.qty-btn {
    width: 24px;
    height: 24px;
    background: #eee8e0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.qty-display {
    font-size: 12.5px;
    font-weight: 600;
    min-width: 14px;
    text-align: center;
}

.btn-remove-item {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 6px;
}

.gift-note-wrap {
    margin-bottom: 10px;
}

.gift-note-wrap label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--mh-text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gift-note-wrap textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--mh-border);
    border-radius: 8px;
    font-size: 12px;
    resize: vertical;
    box-sizing: border-box;
    min-height: 48px;
}

/* Footer Action Area */
.box-card-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--mh-border-light);
    background: #ffffff;
    flex-shrink: 0;
}

.subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--mh-text-muted);
}

.subtotal-row strong {
    font-size: 21px;
    font-weight: 800;
    color: var(--mh-espresso);
}

.btn-checkout-hamper {
    width: 100%;
    padding: 13px;
    background: var(--mh-gold);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(197, 155, 99, 0.35);
    transition: all 0.2s ease;
}

.btn-checkout-hamper:hover:not(:disabled) {
    background: var(--mh-gold-dark);
    transform: translateY(-1px);
}

.btn-checkout-hamper:disabled {
    background: #ded7cf;
    color: #8c857e;
    cursor: not-allowed;
    box-shadow: none;
}

/* Floating Bottom Bar for Mobile (<1025px) */
.mohiva-mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid var(--mh-border);
    padding: 10px 16px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    z-index: 400;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 1024px) {
    .mohiva-mobile-bottom-bar {
        display: flex;
    }
}

.mobile-bar-meta {
    display: flex;
    flex-direction: column;
}

.mobile-bar-count {
    font-size: 11.5px;
    color: var(--mh-text-muted);
    font-weight: 600;
}

.mobile-bar-total {
    font-size: 18px;
    font-weight: 800;
    color: var(--mh-espresso);
    line-height: 1.2;
}

.mobile-bar-btn {
    background: var(--mh-gold);
    color: #ffffff;
    border: none;
    border-radius: 24px;
    padding: 10px 18px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(197, 155, 99, 0.3);
}
