html,
body {
    overflow-x: hidden !important;
    width: 100%;
}

/* Fix global unwanted overflows by forcing all content to respect width */
* {
    box-sizing: border-box;
}



.thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e6e6e6;
    margin-right: 8px;
}

.product-meta {
    font-size: 13px;
    color: #6b7280;
}

.card .body .bullets div {
    color: #374151;
}

.tag {
    font-weight: 700;
    font-size: 12px;
    border-radius: 999px;
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
}

.tag[data-moq="0"] {
    background: #ecfdf5;
    border-color: #bbf7d0
}

.drawer-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* Make gallery images match product card size */
/* ---- Responsive, non-pixelated gallery images ---- */
.gallery-item {
    margin-top: 15px;
}

.gallery-item img,
.sidebar-gallery-grid img,
.drawer-gallery img {
    width: 100%;
    max-height: 400px;
    /* Desktop max height */
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #ddd;
    display: block;
}

/* FIX GALLERY IMAGE ALIGNMENT */
.gallery-item .img-box {
    width: 100%;
    height: 400px;
    /* same as product images */
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #ddd;
}

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


/* Laptop */
@media (max-width: 1200px) {

    .gallery-item img,
    .sidebar-gallery-grid img {
        max-height: 220px;
    }
}

/* Tablet */
@media (max-width: 768px) {

    .gallery-item img,
    .sidebar-gallery-grid img {
        max-height: 180px;
    }
}

/* Mobile */
@media (max-width: 480px) {

    .gallery-item img,
    .sidebar-gallery-grid img {
        max-height: 240px;
        /* Larger — mobile needs bigger visual */
    }

    .gallery-item .img-box {
        height: auto !important;
        /* remove fixed height */
    }

    .gallery-item .img-box img {
        height: auto !important;
        max-height: none;
        width: 100%;
        object-fit: cover;
    }
}



/* Improve popup label + input spacing */
.drawer .panel label {
    display: block;
    margin-bottom: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.drawer .panel label input,
.drawer .panel label select,
.drawer .panel label textarea {
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color .2s;
}

.drawer .panel label textarea {
    min-height: 90px;
    resize: vertical;
}

/* Input focus effect */
.drawer .panel label input:focus,
.drawer .panel label select:focus,
.drawer .panel label textarea:focus {
    border-color: #2563eb;
}

/* Row spacing */
.drawer .panel .row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.drawer .panel .row label {
    flex: 1;
}

/* Fix top section spacing */
#drawerBody {
    margin-top: 15px;
}

.gallery-box {
    margin-top: 30px;
    padding: 12px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.gallery-title {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 700;
}

.sidebar-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}


.gallery-caption {
    font-size: 11px;
    text-align: center;
    margin-top: 2px;
    color: #4b5563;
}

/* GALLERY GRID BASE */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}



/* For mobile & tablets */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(1, 1fr);
    }

}

.gallery-item {
    cursor: pointer;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}



/* --- TITLE SECTION --- */
.gallery-caption {
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    /* dark rich text */
    text-align: center;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}





#galleryPanel {
   /* margin-top: 100px;*/
    /* Same height as your fixed banner */
    padding: 0 16px 40px;
    /* left/right + bottom padding */
}

.gallery-item {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeIn 0.45s ease forwards;
}

/* Stagger effect: nth-child delays */
.gallery-item:nth-child(1) {
    animation-delay: .05s;
}

.gallery-item:nth-child(2) {
    animation-delay: .10s;
}

.gallery-item:nth-child(3) {
    animation-delay: .15s;
}

.gallery-item:nth-child(4) {
    animation-delay: .20s;
}

.gallery-item:nth-child(5) {
    animation-delay: .25s;
}

.gallery-item:nth-child(6) {
    animation-delay: .30s;
}

.gallery-item:nth-child(7) {
    animation-delay: .35s;
}

.gallery-item:nth-child(8) {
    animation-delay: .40s;
}

/* Will wrap naturally for more items */

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

#colorFilter {
    display: none !important;
}

@media (max-width: 768px) {

    .content-wrapper,
    .page-content,
    main {
        padding-top: 70px !important;
        /* Adjust to your header height */
    }
}

.header-wrapper {
    position: fixed;
    width: 100%;
    z-index: 9999;
}

/* PUSH CONTENT BELOW FIXED BANNER ON MOBILE */
@media (max-width: 768px) {

    .fixed-banner {
        display: none !important;
    }

    .main,
    .sidebar,
    #galleryPanel {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
}

/* Gallery Panel: Quote Button */
.gallery-quote-ghost {
    width: 100%;
    margin: 6px 0 4px;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    color: #fb5109;
    /* teal accent */
    border: 1px solid #fb5109;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s ease;
}

.gallery-quote-ghost:hover {
    background: #fb5109;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.gallery-quote-ghost:active {
    transform: translateY(0);
    box-shadow: none;
}

.drawer-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 10px;
}

/* Thumbnail Row */
.drawer-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.drawer-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: .2s;
}

.drawer-thumbs img:hover {
    transform: scale(1.06);
}

/* Big Image */
.drawer-main-image-box {
    width: 100%;
    display: flex;
    justify-content: center;
}

.drawer-main-image {
    width: 100%;
    max-width: 460px;
    height: auto;
    max-height: 340px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid #ddd;
}

/* Product Info */
.drawer-info {
    padding: 6px 0;
}

.drawer-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 4px;
}

.drawer-meta {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 2px;
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .drawer-main-image {
        max-height: 260px;
    }
}

/* Drawer Base */
.drawer {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.drawer.open {
    display: block;
}

.scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}

.drawer-panel {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: #fff;
    padding: 16px;
    overflow-y: auto;
    animation: slideIn .25s ease-out;
}

@media (min-width: 1200px) {
    .drawer-panel {
        width: 540px;
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .drawer-panel {
        width: 420px;
    }
}

@media (max-width: 767px) {
    .drawer-panel {
        width: 100%;
    }
}


@keyframes slideIn {
    from {
        transform: translateX(40px);
        opacity: 0;
    }
}

/* Mobile full sheet */
@media (max-width: 600px) {
    .drawer-panel {
        width: 100%;
        height: 92%;
        bottom: 0;
        top: auto;
        border-radius: 16px 16px 0 0;
        animation: slideUp .3s ease-out;
    }

    @keyframes slideUp {
        from {
            transform: translateY(40px);
            opacity: .3;
        }
    }
}

/* Header */
.drawer-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-close-btn {
    padding: 6px 12px;
    border: 1px solid #999;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

/* Thumbnails */
.thumb-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-top: 10px;
}

.thumb-strip img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
}

/* Main Image */
.main-image-box {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.main-image {
    width: 100%;
    max-width: 540px;
    height: auto;
    max-height: 420px;
    /* safe desktop limit */
    object-fit: contain;
    /* ✅ NO CROPPING */
    background: #f9fafb;
    /* optional neutral bg */
    border-radius: 12px;
    border: 1px solid #ddd;
}

/* Info */
.drawer-title {
    font-size: 18px;
    font-weight: 700;
}

.drawer-meta {
    font-size: 14px;
    color: #555;
}

/* Form */
.drawer-form label {
    display: block;
    margin-top: 12px;
}

.drawer-form input,
.drawer-form select,
.drawer-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 8px;
}

/* Two columns → single on mobile */
.form-row {
    display: flex;
    gap: 12px;
}

.form-row label {
    flex: 1;
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }
}

/* Error box */
.drawer-error {
    display: none;
    background: #ffe6e6;
    padding: 8px;
    border-radius: 8px;
    color: #b30000;
    margin-top: 10px;
}

/* Actions */
.drawer-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.submit-btn {
    background: #fb5109;
    color: white;
}

@media (max-width: 600px) {
    .drawer-actions {
        flex-direction: column;
    }

    .drawer-actions button {
        width: 100%;
        padding: 12px;
        border-radius: 8px;
    }
}


/* Drawer Form Spacing */
.drawer .panel label {
    display: block;
    margin-bottom: 20px;
    /* space between fields */
}

.drawer .panel input,
.drawer .panel select,
.drawer .panel textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    margin-top: 6px;
    /* space between label & input */
}

.drawer .panel label input,
.drawer .panel label select,
.drawer .panel label textarea {
    margin-top: 8px !important;
    /* spacing between label text and input */
}


/* Hide sidebar on mobile */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
    }
}

/* MOBILE HORIZONTAL MENU */
.mobile-menu-wrapper {
    display: none;
}

@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
    }


    .content {
        padding-top: 20px !important;
    }

    /* Fix global unwanted overflows by forcing all content to respect width */
    * {
        max-width: 100%;
        box-sizing: border-box;
    }

    .fixed-banner .wrap {
        flex-wrap: wrap !important;
        width: 100% !important;
    }

    .fixed-banner .wrap>div {
        width: 100% !important;
    }

    .filters {
        width: 100% !important;
        display: flex;
        gap: 10px;
    }

    .filters input,
    .filters select {
        flex: 1;
        max-width: 100% !important;
    }

    .fixed-banner {
        overflow-x: hidden !important;
    }

    .mobile-menu-wrapper {
        display: block;
        padding: 12px;
        background: #fff;
        position: sticky;
        top: 0;
        z-index: 9999;
        overflow-x: hidden;
    }

    .mobile-scroll-menu {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 10px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .mobile-scroll-menu::-webkit-scrollbar {
        display: none;
    }

    .mobile-scroll-menu .m-item {
        flex: 0 0 auto;
        padding: 8px 14px;
        border-radius: 999px;
        background: #f3f4f6;
        border: 1px solid #e5e7eb;
        font-size: 14px;
        cursor: pointer;
        transition: 0.2s;
    }

    .mobile-scroll-menu .m-item.active {
        background: #fb5109;
        color: #fff;
        border-color: #fb5109;
        font-weight: 600;
    }

    .grid,
    .gallery-grid {
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .grid>*,
    .gallery-grid>* {
        max-width: 100% !important;
    }

    .card {
        width: 100%;
        max-width: 100%;
    }

    img {
        max-width: 100% !important;
        height: auto;
    }

    .fixed-banner .wrap>* {
        flex-shrink: 1 !important;
    }

    .gallery-item,
    .gallery-item .img-box {
        max-width: 100% !important;
        overflow: hidden !important;
    }

    #galleryPanel {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }


    .app,
    .main,
    .content {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box;
    }


    .grid,
    .gallery-grid {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .app,
    .main,
    .content,
    .grid,
    .gallery-grid,
    #galleryPanel {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Also prevent flex children from stretching */
    .fixed-banner .wrap {
        max-width: 100% !important;
        overflow-x: hidden !important;
        flex-wrap: wrap;
    }

    /* Prevent product cards from overflowing */
    .card,
    .gallery-item {
        max-width: 100% !important;
    }

}


body.no-scroll {
    overflow: hidden !important;
    height: 100vh;
    position: fixed;
    width: 100%;
}

.tag-color-1 {
    background: #FFF7E6;
    color: #B65C00;
    border-color: #FFE0B3;
}

/* soft yellow-orange */
.tag-color-2 {
    background: #E6F7FF;
    color: #005A8E;
    border-color: #B3E5FF;
}

/* soft blue */
.tag-color-3 {
    background: #E8FFE6;
    color: #1C7A00;
    border-color: #BBFFB3;
}

/* soft green */
.tag-color-4 {
    background: #FDEBFF;
    color: #8000A1;
    border-color: #F3C6FF;
}

/* soft violet */
.tag-color-5 {
    background: #FFECEC;
    color: #A10000;
    border-color: #FFC2C2;
}


/* Fix custom drawer actions flowing inside form */
#customDrawer .panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#customDrawer .panel .actions {
    margin-top: auto !important;
    /* Push actions to bottom */
    padding-top: 12px;
    padding-bottom: 16px;
    background: #fff;
}

/* Mobile layout: buttons full width */
@media (max-width: 600px) {
    #customDrawer .panel .actions {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    #customDrawer .panel .actions button {
        width: 100%;
    }
}


/* Make drawer panel a flex column */
.custom-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
}

/* Header format */
.custom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* Form scroll area */
.custom-form {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

/* Fix spacing */
.custom-form label {
    display: block;
    margin-bottom: 16px;
}

.custom-form select,
.custom-form input {
    width: 100%;
    padding: 10px 12px;
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Two-column row */
.custom-form .row {
    display: flex;
    gap: 12px;
}

.custom-form .row label {
    flex: 1;
}

/* Bottom fixed actions */
.custom-actions {
    margin-top: auto;
    padding-top: 16px;
    display: flex;
    gap: 12px;
}

.custom-actions .btn.submit {
    flex: 1;
    background: #fb5109 !important;
    color: white !important;
    border: 1px solid #fb5109 !important;
}

.custom-actions .btn.ghost {
    flex: 1;
}

/* Mobile layout */
@media (max-width: 600px) {
    .custom-actions {
        flex-direction: column;
    }

    .custom-actions button {
        width: 100%;
        padding: 12px;
        border-radius: 8px;
    }
}

#catalogFilters {
    display: none;
}


.mobile-filters {
    display: none;
    background: #fff;
    gap: 10px;
}

.mobile-filters input,
.mobile-filters select {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .mobile-filters {
        display: none;
        position: sticky;
        top: 0;
        z-index: 9998;
    }

    .mobile-filters input,
    .mobile-filters select {
        flex: 1 1 0;
        /* 🔥 allow shrinking */
        min-width: 0;
        /* 🔥 REQUIRED for select */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Prevent select from causing horizontal scroll */
    .mobile-filters select {
        appearance: none;
        /* normalize browser behavior */
        -webkit-appearance: none;
    }
}