﻿/* ══════════════════════════════════════════
       BRANCHES SECTION
    ══════════════════════════════════════════ */
.branches-section {
    position: relative;
    background: #fff8f2;
    overflow: hidden;
    height: 100vh;
}

    /* Subtle noise texture */
    .branches-section::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
        background-size: 180px 180px;
        opacity: 0.035;
        pointer-events: none;
        z-index: 0;
    }

.branches-inner {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 48px 96px;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
}

/* ── Header ── */
.branches-header {
    z-index: 0;
}

.branches-right {
    pointer-events: auto;
}

.branches-label {
    display: inline-block;
    font-family: var(--font-heading-family);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    color: #ffffff;
    background: #ffad2dab;
    border: 1.5px solid rgb(255 217 110);
    border-radius: 999px;
    padding: 0.28rem 1rem;
    margin-bottom: 1rem;
}

.branches-title {
    font-family: var(--font-heading-family);
    font-size: clamp(2.8rem, 6vw, 5rem);
    line-height: 1;
    color: #1a0000;
    margin: 0 0 0.75rem;
}

    .branches-title span {
        color: var(--red);
    }

.branches-sub {
    font-family: var(--font-heading-family);
    font-size: 1rem;
    color: var(--dark-red);
    transition: all 0.3s ease;
}

.branches-panel-toggle {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-top: 0.85rem;
    padding: 0.65rem 1rem;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: rgba(117, 16, 8, 0.9);
    box-shadow: 0 6px 18px rgba(58, 8, 3, 0.2);
    color: #fff;
    font-family: var(--font-heading-family);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

    .branches-panel-toggle:hover {
        background: var(--red);
        box-shadow: 0 8px 22px rgba(58, 8, 3, 0.3);
        transform: translateY(-2px);
    }

    .branches-panel-toggle:focus-visible {
        outline: 3px solid var(--yellow);
        outline-offset: 3px;
    }

.branches-panel-toggle__icon {
    display: grid;
    width: 1.25rem;
    height: 1.25rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    font-size: 1.25rem;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 0.25s ease;
}

.branches-section.is-panel-hidden .branches-panel-toggle__icon {
    transform: rotate(180deg);
}

.branches-section.is-panel-hidden .branches-body {
    min-height: 0;
}

.branches-right[hidden] {
    display: none;
}

/* ── Body layout ── */
.branches-body {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 32px;
    align-items: stretch;
    min-height: 560px;
}

/* ── Map ── */
.branches-map-wrap {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 0;
    border: none;
}

.branches-map {
    width: 100%;
    height: 100%;
}

/* ── Right panel ── */
.branches-right {
    background: white;
    border-radius: 20px;
    padding: 24px;
    animation: rightPanelFloat 3s ease-in-out infinite;
    box-shadow: 4px 4px 8px #0000007e;
    display: flex;
    flex-direction: column;
    height: 94%;
}

@keyframes rightPanelFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

/* ── Carousel header ── */
.branches-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.branches-carousel-label {
    font-family: var(--font-heading-family);
    font-size: 1rem;
    font-weight: 800;
    color: var(--red);
    text-transform: uppercase;
}

.branches-carousel-hint {
    font-family: var(--font-heading-family);
    font-size: 0.68rem;
    color: rgba(26, 0, 0, 0.5);
    font-style: italic;
}

/* ── Filters ── */
.branches-filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.branches-filter-select {
    flex: 1;
    border: 1.5px solid rgba(26, 0, 0, 0.18);
    border-radius: 8px;
    padding: 6px 26px 6px 10px;
    font-family: var(--font-heading-family);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(26, 0, 0, 0.6);
    background-color: rgba(0, 0, 0, 0.03);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

    .branches-filter-select:hover {
        border-color: var(--red);
        color: var(--red);
    }

    .branches-filter-select.filter-active {
        border-color: var(--red);
        color: var(--red);
        background-color: rgba(204, 34, 0, 0.05);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cc2200' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    }

/* ── Active filter tags ── */
.branches-filter-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.branches-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-heading-family);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
}

.branches-filter-tag--city {
    background: rgba(204, 34, 0, 0.08);
    color: var(--red);
    border: 1px solid rgba(204, 34, 0, 0.22);
}

.branches-filter-tag--hours {
    background: rgba(255, 173, 45, 0.12);
    color: var(--dark-red);
    border: 1px solid rgba(193, 118, 0, 0.28);
}

.branches-filter-tag-clear {
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
    padding: 0 2px;
    background: none;
    border: none;
    color: inherit;
}

    .branches-filter-tag-clear:hover {
        opacity: 1;
    }

/* ── Empty state ── */
.branches-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 16px;
    font-family: var(--font-heading-family);
    font-size: 0.85rem;
    color: rgba(26, 0, 0, 0.45);
    text-align: center;
}

.branches-empty-clear {
    font-family: var(--font-heading-family);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red);
    background: none;
    border: 1.5px solid var(--red);
    border-radius: 999px;
    padding: 4px 14px;
    cursor: pointer;
    transition: background 0.15s ease;
}

    .branches-empty-clear:hover {
        background: rgba(204, 34, 0, 0.07);
    }

/* ── Carousel ── */
.branches-carousel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 430px;
    overflow: hidden;
    padding-right: 6px;
    scrollbar-width: none;
}

.branches-carousel-track {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.branches-carousel.is-filtered {
    overflow-y: auto;
    overflow-x: hidden;
}

.branches-carousel-track.no-scroll {
    animation: none !important;
    transform: none !important;
    transition: none !important;
}

/* ── Branch card ── */
.bcard {
    position: relative;
    border: 3px solid var(--red);
    border-radius: 14px;
    padding: 16px 20px;
    cursor: pointer;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    box-shadow: 3px 3px 0 var(--red);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

    .bcard:hover {
        box-shadow: 5px 5px 0 var(--red);
        transform: translateY(-2px);
    }

.bcard-city {
    font-family: var(--font-heading-family);
    font-size: 1rem;
    color: var(--yellow);
    grid-column: 1;
    grid-row: 1;
}

.bcard-name {
    font-family: var(--font-heading-family);
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--dark-red);
    grid-column: 1;
    grid-row: 2;
    line-height: 1.3;
    text-transform: uppercase;
}

.bcard-hours {
    font-family: var(--font-heading-family);
    font-size: 0.68rem;
    color: var(--red);
    grid-column: 1;
    grid-row: 3;
    margin-top: 4px;
}

.bcard-arrow {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.2);
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.bcard:hover .bcard-arrow {
    color: var(--red);
    transform: translateX(3px);
}

/* ── Delivery platforms ── */
.branches-delivery-badge {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
}

.branches-delivery-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    border: 1.5px dashed rgba(0, 0, 0, 0.12);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

    .branches-delivery-card:hover {
        background: rgba(0, 0, 0, 0.07);
        border-color: rgba(0, 0, 0, 0.25);
        transform: translateY(-2px);
        box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
    }

.branches-delivery-logo {
    height: 32px;
    width: 32px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.branches-delivery-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.branches-delivery-also {
    font-family: var(--font-heading-family);
    font-size: 0.6rem;
    color: rgba(26, 0, 0, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.branches-delivery-name {
    font-family: var(--font-heading-family);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Detail panel ── */
.branches-detail {
    position: relative;
    background: white;
    border: solid 4px var(--red);
    border-radius: 12px;
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: detailIn 0.35s cubic-bezier(.22, 1, .36, 1) both;
}

.branches-detail-phone {
    text-decoration: none;
    transition: opacity 0.15s ease;
    text-decoration-line: underline;
    text-underline-position: from-font;
}

    .branches-detail-phone:hover {
        transform: scale(101%);
    }

@keyframes detailIn {
    from {
        opacity: 0;
        transform: translateX(16px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.branches-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    color: #1a0000;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: none;
    border: none;
}

    .branches-detail-close:hover {
        transform: rotate(90deg);
        background: var(--red);
        color: white;
    }

.branches-img-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 20px;
    border-radius: 10px;
    scrollbar-width: none;
}

    .branches-img-carousel::-webkit-scrollbar {
        display: none;
    }

.branches-img-slide {
    flex-shrink: 0;
    width: 160px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .branches-img-slide:hover {
        box-shadow: 4px 4px 0 var(--red);
        transform: translateY(-2px);
    }

.branches-detail-city {
    font-family: var(--font-heading-family);
    font-size: 1rem;
    text-transform: uppercase;
    color: var(--dark-red);
    margin-bottom: 2px;
}

.branches-detail-name {
    font-family: var(--font-heading-family);
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: var(--red);
    line-height: 1.1;
    padding-bottom: 8px;
    margin-bottom: 16px;
    border-bottom: dashed 1px #c17600;
}

.branches-detail-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: dashed 1px #c17600;
}

.branches-detail-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.branches-detail-text {
    font-family: var(--font-heading-family);
    font-size: 0.88rem;
    line-height: 1.55;
}

.branches-detail-actions {
    margin-top: auto;
    padding-top: 24px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.branches-detail-menu {
    display: inline-block;
    background: var(--off-white);
    color: var(--red);
    border: 3px solid var(--red);
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    font-family: var(--font-heading-family);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 3px 3px 0 var(--red);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    width: 40%;
    text-align: center;
    cursor: pointer;
}

    .branches-detail-menu:hover {
        box-shadow: 5px 5px 0 var(--red);
        transform: translateY(-2px);
    }

.branches-detail-maps {
    display: inline-block;
    background: var(--red);
    color: white;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    font-family: var(--font-heading-family);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    box-shadow: 3px 3px 0 white;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .branches-detail-maps:hover {
        box-shadow: 5px 5px 0 var(--yellow);
        transform: translateY(-2px);
    }

/* ── Image Lightbox Modal ── */
.img-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: backdropIn 0.25s ease both;
}

@keyframes backdropIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.img-modal {
    position: relative;
    max-width: min(92vw, 680px);
    height: 92vh;
    overflow: hidden;
    background: #111;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.6);
    animation: modalIn 0.35s cubic-bezier(.22,1,.36,1) both;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(28px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.img-modal__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.img-modal__caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    font-family: var(--font-heading-family);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark-red);
    text-align: center;
    padding: 1rem;
    margin: 0;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--yellow);
    border-top: 7px solid var(--dark-red);
    flex-shrink: 0;
}

.img-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: background 0.2s ease, transform 0.2s ease;
}

    .img-modal__close:hover {
        background: var(--red, #cc0000);
        transform: rotate(90deg);
    }

    .img-modal__close span {
        display: block;
        width: 100%;
        height: 2px;
        background: #fff;
        border-radius: 999px;
    }

        .img-modal__close span:nth-child(1) {
            transform: translateY(1px) rotate(45deg);
        }

        .img-modal__close span:nth-child(2) {
            transform: translateY(-1px) rotate(-45deg);
        }

/* ══════════════════════════════════════════
       RESPONSIVE
    ══════════════════════════════════════════ */
@media (max-width: 959px) {
    .branches-section {
        height: 90vh;
    }

    .branches-inner {
        padding: 24px 16px;
        flex-direction: column;
        gap: 16px;
        height: 100%;
        justify-content: flex-end;
    }

    .branches-header {
        pointer-events: none;
    }

    .branches-title {
        font-size: 2.2rem;
    }

    .branches-sub {
        font-size: 0.78rem;
    }

    .branches-body {
        display: block;
        min-height: unset;
    }

    .branches-right {
        width: 100%;
        padding: 16px;
        border-radius: 16px;
        animation: none;
    }

    .branches-filter-row {
        flex-direction: column;
        gap: 6px;
    }
    /* Horizontal carousel */
    .branches-carousel {
        flex-direction: row;
        height: 145px;
        overflow: hidden;
        padding-right: 0;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .branches-carousel-track {
        height: 120px;
        flex-direction: row;
        gap: 10px;
    }

    .bcard {
        flex-shrink: 0;
        width: 180px;
        padding: 10px 14px;
        gap: 0 8px;
    }

    .bcard-city {
        font-size: 0.65rem;
    }

    .bcard-name {
        font-size: 0.95rem;
        line-height: 1.15;
    }

    .bcard-hours {
        font-size: 0.6rem;
        margin-top: 2px;
    }

    .bcard-arrow {
        font-size: 0.85rem;
    }
    /* Detail panel */
    .branches-detail {
        height: auto;
    }

    .branches-detail-name {
        font-size: 1.4rem;
        margin: 0 0 16px;
    }

    .branches-detail-row {
        margin-bottom: 10px;
    }

    .branches-detail-text {
        font-size: 0.82rem;
    }

    .branches-detail-actions {
        flex-direction: column;
        padding-top: 16px;
    }

    .branches-detail-maps,
    .branches-detail-menu {
        width: 100%;
        text-align: center;
        display: block;
    }

    .branches-detail-city {
        font-size: 0.58rem;
    }
}

@media (max-width: 640px) {
    .branches-inner {
        padding: 48px 20px 64px;
    }

    .branches-map {
        min-height: 320px;
    }

    .branches-detail {
        padding: 24px 20px;
    }
}
