/* =================================================================
   Kasha Box Plugin - Frontend CSS
   Prefix: NeerajBoxxXxXfghjpuGG  |  Divi 5 & W3C Compatible
   ================================================================= */

:root {
    --kasha-primary:    #d3ad68;
    --kasha-primary-dk: #b8923f;
    --kasha-text:       #333333;
    --kasha-white:      #ffffff;
    --kasha-bg:         #f9f9f9;
    --kasha-border:     #ebebeb;
    --kasha-radius:     12px;
    --kasha-shadow:     0 5px 20px rgba(0,0,0,0.09);
    --kasha-shadow-lg:  0 20px 60px rgba(0,0,0,0.22);
    --kasha-ease:       all 0.3s ease-in-out;
}

/* ----------------------------------------------------------------
   MAIN GRID
---------------------------------------------------------------- */
.NeerajBoxxXxXfghjpuGG-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px;
    padding: 20px 0;
    box-sizing: border-box;
}

/* ----------------------------------------------------------------
   BOX CARD
---------------------------------------------------------------- */
.NeerajBoxxXxXfghjpuGG-item {
    background: var(--kasha-white);
    border-radius: var(--kasha-radius);
    overflow: hidden;
    position: relative;
    box-shadow: var(--kasha-shadow);
    cursor: pointer;
    transition: var(--kasha-ease);
    border: 1px solid var(--kasha-border);
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
}

.NeerajBoxxXxXfghjpuGG-item:hover {
    background: var(--kasha-primary);
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(211,173,104,0.35);
    border-color: var(--kasha-primary);
}

/* Image Wrap */
.NeerajBoxxXxXfghjpuGG-img-wrap {
    width: 100%;
    height: 195px;
    overflow: hidden;
    background: #f1f1f1;
    flex-shrink: 0;
}

.NeerajBoxxXxXfghjpuGG-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.NeerajBoxxXxXfghjpuGG-item:hover .NeerajBoxxXxXfghjpuGG-img-wrap img {
    transform: scale(1.08);
}

/* Badge (child count) */
.NeerajBoxxXxXfghjpuGG-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--kasha-primary);
    color: var(--kasha-white);
    padding: 4px 11px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    transition: var(--kasha-ease);
}

.NeerajBoxxXxXfghjpuGG-item:hover .NeerajBoxxXxXfghjpuGG-badge {
    background: var(--kasha-white);
    color: var(--kasha-primary);
}

/* Content */
.NeerajBoxxXxXfghjpuGG-content {
    padding: 18px 16px;
    text-align: center;
    transition: var(--kasha-ease);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.NeerajBoxxXxXfghjpuGG-content h3 {
    margin: 0 0 8px;
    font-size: 17px;
    color: var(--kasha-text);
    font-weight: 600;
    line-height: 1.3;
    transition: var(--kasha-ease);
}

.NeerajBoxxXxXfghjpuGG-content p {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.55;
    transition: var(--kasha-ease);
}

.NeerajBoxxXxXfghjpuGG-item:hover .NeerajBoxxXxXfghjpuGG-content h3,
.NeerajBoxxXxXfghjpuGG-item:hover .NeerajBoxxXxXfghjpuGG-content p {
    color: var(--kasha-white);
}

/* ----------------------------------------------------------------
   MAIN POPUP OVERLAY
---------------------------------------------------------------- */
#NeerajBoxxXxXfghjpuGG-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.82);
    z-index: 9999990;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 15px;
    box-sizing: border-box;
}

#NeerajBoxxXxXfghjpuGG-overlay.kasha-show {
    opacity: 1;
    visibility: visible;
}

/* Modal Box */
#NeerajBoxxXxXfghjpuGG-modal {
    background: var(--kasha-bg);
    width: 100%;
    max-width: 980px;
    max-height: 90vh;
    border-radius: var(--kasha-radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--kasha-shadow-lg);
    transform: scale(0.93) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    overflow: hidden;
}

#NeerajBoxxXxXfghjpuGG-overlay.kasha-show #NeerajBoxxXxXfghjpuGG-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.NeerajBoxxXxXfghjpuGG-modal-header {
    padding: 16px 24px;
    background: var(--kasha-white);
    border-bottom: 2px solid var(--kasha-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.NeerajBoxxXxXfghjpuGG-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--kasha-text);
    font-weight: 700;
    flex-grow: 1;
    text-align: center;
    line-height: 1.3;
}

/* Back Button */
.NeerajBoxxXxXfghjpuGG-back-btn {
    background: transparent;
    border: 1.5px solid var(--kasha-primary);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--kasha-primary);
    cursor: pointer;
    transition: var(--kasha-ease);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.NeerajBoxxXxXfghjpuGG-back-btn:hover {
    background: var(--kasha-primary);
    color: var(--kasha-white);
}

/* Close Button */
.NeerajBoxxXxXfghjpuGG-close-btn {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s, transform 0.2s;
    padding: 4px 6px;
    line-height: 1;
    flex-shrink: 0;
}

.NeerajBoxxXxXfghjpuGG-close-btn:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

/* Modal Body */
.NeerajBoxxXxXfghjpuGG-modal-body {
    padding: 28px;
    overflow-y: auto;
    flex-grow: 1;
    scroll-behavior: smooth;
}

.NeerajBoxxXxXfghjpuGG-modal-body::-webkit-scrollbar { width: 6px; }
.NeerajBoxxXxXfghjpuGG-modal-body::-webkit-scrollbar-track { background: #f1f1f1; }
.NeerajBoxxXxXfghjpuGG-modal-body::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.NeerajBoxxXxXfghjpuGG-modal-body::-webkit-scrollbar-thumb:hover { background: var(--kasha-primary); }

/* Loader */
.NeerajBoxxXxXfghjpuGG-loader {
    display: none;
    text-align: center;
    padding: 50px 20px;
    color: var(--kasha-primary);
    font-size: 17px;
    font-weight: 600;
    gap: 10px;
}

.NeerajBoxxXxXfghjpuGG-loader i {
    font-size: 26px;
    display: block;
    margin-bottom: 10px;
}

/* Error msg */
.kasha-error {
    color: #e74c3c;
    text-align: center;
    padding: 30px;
    font-size: 15px;
}

/* ----------------------------------------------------------------
   POPUP INNER LAYOUTS
---------------------------------------------------------------- */

/* Sub-boxes grid inside popup */
.NeerajBoxxXxXfghjpuGG-popup-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 20px;
    padding: 0;
}

/* Optional description above sub-boxes */
.NeerajBoxxXxXfghjpuGG-popup-desc {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    border-left: 3px solid var(--kasha-primary);
    padding-left: 14px;
    margin-bottom: 24px;
}

/* Detail wrapper (gallery + table) */
.NeerajBoxxXxXfghjpuGG-popup-details {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ----------------------------------------------------------------
   GALLERY GRID
---------------------------------------------------------------- */
.NeerajBoxxXxXfghjpuGG-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.NeerajBoxxXxXfghjpuGG-gallery img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.10);
    display: block;
}

.NeerajBoxxXxXfghjpuGG-gallery img:hover {
    transform: scale(1.04);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

/* ----------------------------------------------------------------
   SIZES TABLE
---------------------------------------------------------------- */
.NeerajBoxxXxXfghjpuGG-sizes-wrap {
    overflow-x: auto;
}

.NeerajBoxxXxXfghjpuGG-sizes-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--kasha-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    min-width: 300px;
}

.NeerajBoxxXxXfghjpuGG-sizes-table th,
.NeerajBoxxXxXfghjpuGG-sizes-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    line-height: 1.4;
}

.NeerajBoxxXxXfghjpuGG-sizes-table th {
    background: var(--kasha-primary);
    color: var(--kasha-white);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.NeerajBoxxXxXfghjpuGG-sizes-table tr:last-child td { border-bottom: none; }

.NeerajBoxxXxXfghjpuGG-sizes-table tr:hover td {
    background: rgba(211,173,104,0.07);
}

/* Fallback single image */
.NeerajBoxxXxXfghjpuGG-popup-single-img {
    text-align: center;
    margin-bottom: 20px;
}

/* ================================================================
   LIGHTBOX OVERLAY (Full Screen Image Viewer)
================================================================ */
#kasha-lightbox-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.94);
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#kasha-lightbox-overlay.kasha-lightbox-show {
    opacity: 1;
    visibility: visible;
}

/* Image Wrapper */
.kasha-lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 88vw;
    max-height: 88vh;
    position: relative;
}

#kasha-lightbox-img {
    max-width: 100%;
    max-height: 88vh;
    border-radius: 8px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.6);
    object-fit: contain;
    transition: opacity 0.2s ease, transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    transform: scale(0.9);
    display: block;
}

#kasha-lightbox-overlay.kasha-lightbox-show #kasha-lightbox-img {
    transform: scale(1);
}

/* Close Button */
.kasha-lightbox-close {
    position: fixed;
    top: 18px;
    right: 22px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, transform 0.25s;
    z-index: 10000000;
}

.kasha-lightbox-close:hover {
    background: #e74c3c;
    transform: rotate(90deg);
}

/* Prev / Next Buttons */
.kasha-lightbox-prev,
.kasha-lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, transform 0.25s;
    z-index: 10000000;
}

.kasha-lightbox-prev { left: 16px; }
.kasha-lightbox-next { right: 16px; }

.kasha-lightbox-prev:hover { background: var(--kasha-primary); transform: translateY(-50%) scale(1.1); }
.kasha-lightbox-next:hover { background: var(--kasha-primary); transform: translateY(-50%) scale(1.1); }

/* Counter */
.kasha-lightbox-counter {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.55);
    color: #fff;
    padding: 5px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    z-index: 10000000;
}

/* ================================================================
   RESPONSIVE
================================================================ */
@media (max-width: 900px) {
    #NeerajBoxxXxXfghjpuGG-modal {
        max-width: 100%;
    }
    .NeerajBoxxXxXfghjpuGG-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    .NeerajBoxxXxXfghjpuGG-popup-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .NeerajBoxxXxXfghjpuGG-container {
        grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
        gap: 18px;
    }
    .NeerajBoxxXxXfghjpuGG-modal-body {
        padding: 18px;
    }
    .NeerajBoxxXxXfghjpuGG-modal-header h2 {
        font-size: 17px;
    }
    .kasha-lightbox-prev { left: 8px; }
    .kasha-lightbox-next { right: 8px; }
    .kasha-lightbox-prev,
    .kasha-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .NeerajBoxxXxXfghjpuGG-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .NeerajBoxxXxXfghjpuGG-popup-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .NeerajBoxxXxXfghjpuGG-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    .NeerajBoxxXxXfghjpuGG-img-wrap { height: 160px; }
    .NeerajBoxxXxXfghjpuGG-modal-body { padding: 14px; }
    .NeerajBoxxXxXfghjpuGG-back-btn { font-size: 12px; padding: 5px 10px; }
}
