/**
 * CRM excursion gallery POP — LAB mosaic layout (7 slots) + focal point.
 * Linked from SERVICE / AGENT / SYSTEM excursion CRM pages.
 */

.crm-exc-sat-pop[data-crm-exc-sat-kind='gallery'] .modal-box {
    width: min(720px, 96vw);
}

.crm-gallery-mosaic-wrap {
    margin-top: 4px;
}

.crm-gallery-mosaic {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 0.36fr);
    grid-template-rows: 1fr 1fr;
    gap: 6px;
    width: 100%;
    height: clamp(220px, 32vw, 300px);
    container-type: inline-size;
}

.crm-gallery-mosaic__thumbs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
    height: clamp(64px, 10vw, 88px);
}

.crm-gal-slot {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 1px dashed #c5ccd6;
    border-radius: 10px;
    overflow: hidden;
    background: #eef1f5;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.crm-gal-slot:hover {
    border-color: #8fa0b8;
    background: #e8ecf2;
}

.crm-gal-slot.is-filled {
    border-style: solid;
    border-color: #d0d7e2;
    background: #111;
}

.crm-gal-slot.is-filled:hover {
    border-color: #9aa8bc;
}

.crm-gal-slot--main {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.crm-gal-slot--side {
    grid-column: 2;
}

.crm-gal-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.crm-gal-slot.is-focal {
    cursor: crosshair;
}

.crm-gal-slot.is-focal img {
    pointer-events: none;
}

.crm-gal-slot__num {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(18, 32, 58, 0.78);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    pointer-events: none;
}

.crm-gal-slot__ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #6b778a;
    pointer-events: none;
}

.crm-gal-slot__del {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 3;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(220, 53, 69, 0.92);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.crm-gal-slot__del:hover {
    background: #c82333;
}

.crm-gal-slot__replace {
    position: absolute;
    top: 4px;
    right: 34px;
    z-index: 3;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(18, 32, 58, 0.82);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.crm-gal-slot__replace:hover {
    background: rgba(29, 78, 216, 0.95);
}

/* Focal marker: only while editing focus (.is-focal) — not a permanent blue dot on every slot */
.crm-gal-slot__focal {
    position: absolute;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(18, 32, 58, 0.45), 0 2px 8px rgba(0, 0, 0, 0.28);
    background: rgba(29, 78, 216, 0.22);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.crm-gal-slot__focal::before,
.crm-gal-slot__focal::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(18, 32, 58, 0.35);
}

.crm-gal-slot__focal::before {
    width: 2px;
    height: 16px;
    margin: -8px 0 0 -1px;
}

.crm-gal-slot__focal::after {
    width: 16px;
    height: 2px;
    margin: -1px 0 0 -8px;
}

.crm-gal-slot.is-focal .crm-gal-slot__focal {
    opacity: 1;
    visibility: visible;
}

.crm-gal-slot__focal-tip {
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translateX(-50%);
    white-space: nowrap;
    max-width: min(200px, 70vw);
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(18, 32, 58, 0.9);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.crm-gal-slot.is-focal {
    outline: 2px solid #1d4ed8;
    outline-offset: 1px;
}

.crm-gallery-focal-hint {
    font-size: 10px;
    color: #5a6578;
    margin: 8px 0 0;
    line-height: 1.4;
    min-height: 14px;
}
