/* ==========================================================================
   PRDSZCHRT - Modern Bottom Sheet & Size Charts Modal Styles
   Brand Palette:
     - Primary Accent: #F37B84
     - Brand Graphite / Dark: #58595B
     - Soft Tint: #FDE8EA
   ========================================================================== */

/* 1. Base Overlay (Desktop & Mobile) */
.pop.pop-5 {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pop.pop-5.active {
    opacity: 1;
    visibility: visible;
}

/* Backdrop blur & overlay */
.pop.pop-5 .pop-bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(88, 89, 91, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1;
    cursor: pointer;
}

/* 2. Modal Container (Desktop defaults) */
.pop.pop-5 .pop__cont {
    position: relative;
    z-index: 2;
    background: #FFFFFF;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 820px;
    max-height: 85vh;
    margin: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    transform: translateY(30px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.pop.pop-5.active .pop__cont {
    transform: translateY(0) scale(1);
}

/* Pull Handle (hidden on desktop) */
.pop.pop-5 .pop-handle {
    display: none;
}

/* Header bar */
.pop.pop-5 .pop__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 16px;
    border-bottom: 1px solid #F1F5F9;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.pop.pop-5 .pop-title {
    font-size: 22px;
    font-weight: 700;
    color: #58595B;
    margin: 0;
    line-height: 1.3;
}

/* Close button */
.pop.pop-5 .pop-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.pop.pop-5 .pop-close:hover {
    background: #FDE8EA;
    transform: scale(1.06);
}

.pop.pop-5 .pop-close svg {
    display: block;
    width: 18px;
    height: 18px;
}

/* Scroll Hint */
.pop.pop-5 .table-scroll-hint {
    display: none;
    font-size: 12px;
    font-weight: 500;
    color: #8E8E93;
    margin-bottom: 10px;
    text-align: center;
    letter-spacing: 0.02em;
}

.pop.pop-5 .table-scroll-hint span {
    color: #F37B84;
    font-weight: 600;
}

/* Table Area */
.pop.pop-5 .pop__table {
    flex: 1;
    overflow-x: auto;
    overflow-y: auto;
    width: 100%;
    padding: 2px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Sleek Scrollbar */
.pop.pop-5 .pop__table::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.pop.pop-5 .pop__table::-webkit-scrollbar-track {
    background: #F8F8F8;
    border-radius: 10px;
}

.pop.pop-5 .pop__table::-webkit-scrollbar-thumb {
    background: #F9B9BE;
    border-radius: 10px;
}

.pop.pop-5 .pop__table::-webkit-scrollbar-thumb:hover {
    background: #F37B84;
}

/* Table / Grid Structure */
.pop.pop-5 table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.pop.pop-5 table th,
.pop.pop-5 table td,
.pop.pop-5 .pop-item {
    padding: 10px 14px;
    font-size: 14px;
    color: #58595B;
    text-align: center;
    border-bottom: 1px solid #F1F5F9;
    border-right: 1px solid #F1F5F9;
    background: #FFFFFF;
    white-space: nowrap;
}

.pop.pop-5 table th,
.pop.pop-5 .pop__row:first-child .pop-item {
    background: #F8FAFC;
    color: #58595B;
    font-weight: 600;
    border-top: 1px solid #F1F5F9;
}

.pop.pop-5 table td:first-child,
.pop.pop-5 table th:first-child,
.pop.pop-5 .pop-item:first-child {
    border-left: 1px solid #F1F5F9;
    font-weight: 600;
}

/* Decorative images */
.pop.pop-5 .pop__cont-bg {
    position: absolute;
    pointer-events: none;
    z-index: -1;
}

/* ==========================================================================
   MOBILE BOTTOM SHEET (@media max-width: 768px) - ТОЧНО ЯК БУЛО
   ========================================================================== */
@media (max-width: 768px) {
    .pop.pop-5 {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .pop.pop-5 .pop__cont {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        min-height: auto !important;
        max-height: 88vh !important;
        height: auto !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 12px 18px 24px 18px !important;
        box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.25) !important;
        transform: translateY(100%) !important;
        transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease !important;
    }

    .pop.pop-5.active .pop__cont {
        transform: translateY(0) !important;
    }

    /* Modern Pull Handle */
    .pop.pop-5 .pop-handle {
        display: block !important;
        width: 44px;
        height: 5px;
        background: #CBD5E1;
        border-radius: 99px;
        margin: 0 auto 12px auto;
        flex-shrink: 0;
        cursor: grab;
    }

    /* Mobile Header */
    .pop.pop-5 .pop__header {
        position: sticky;
        top: 0;
        background: #FFFFFF;
        z-index: 10;
        padding-bottom: 12px;
        margin-bottom: 10px;
    }

    .pop.pop-5 .pop-title {
        font-size: 19px !important;
    }

    .pop.pop-5 .pop-close {
        width: 32px;
        height: 32px;
    }

    /* Mobile scroll hint indicator */
    .pop.pop-5 .table-scroll-hint {
        display: flex !important;
        justify-content: center;
        align-items: center;
        gap: 6px;
    }

    /* Sticky first column for seamless horizontal browsing */
    .pop.pop-5 table td:first-child,
    .pop.pop-5 table th:first-child,
    .pop.pop-5 .pop-item:first-child {
        position: sticky !important;
        left: 0 !important;
        z-index: 3 !important;
        background: #F8FAFC !important;
        box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05);
    }

    /* Hide corner graphics that clutter mobile bottom sheets */
    .pop.pop-5 .pop__cont-bg {
        display: none !important;
    }
}
