/* =========================================================
   NATIONAL GOLF — PANEL FINAL CLEAN UPDATED (APPLE POLISH)
   ========================================================= */

/* ================= PANEL CONTAINER ================= */

.side-panel {
    position: absolute;
    top: 42px;
    bottom: 42px;
    right: 0;
    width: 420px;

    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(14px);
    border-left: 1px solid var(--surface-border);
    border-radius: 26px 0 0 26px;
    box-shadow: -16px 0 36px rgba(57, 45, 15, 0.09);

    display: flex;
    flex-direction: column;
    overflow: hidden;

    z-index: 600;

    opacity: 0;
    filter: blur(8px);
    transform: translateX(calc(100% + 24px)) scale(0.985);
    transition:
        transform .38s cubic-bezier(.2,.8,.2,1),
        opacity .28s ease,
        filter .28s ease;
    will-change: transform, opacity, filter;
}

.side-panel.open {
    opacity: 1;
    filter: none;
    transform: translateX(0) scale(1);
}

/* ================= HEADER ================= */

.panel-header-final {
    padding: 20px 28px 14px;
    background: var(--panel-cap-surface, linear-gradient(180deg, rgba(255,255,255,0.985), rgba(251,248,242,0.94)));
    border-bottom: 1px solid color-mix(in srgb, var(--gold-accent) 16%, transparent);
}

.panel-top-row {
    font-size: var(--label-sm);
    font-weight: 600;
    letter-spacing: var(--tracking-wide);
    text-align: center;
    color: var(--text-label);
}

/* LOT + BULK */

.lot-row-final {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#panel-lot-id,
#panel-apartment-id {
    font-size: var(--title-lg);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin: 0;
}

.badge-bulk {
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface-muted);
    font-size: var(--label-sm);
    font-weight: 500;
    color: var(--text-muted);
}

/* ================= STATUS BADGE ================= */

.status-final {
    margin-top: 12px;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .05em;
    padding: 5px 13px;
    border-radius: 999px;
    display: inline-block;
    width: fit-content;
}

.status-final.reserved { background: var(--status-reserved-bg); color: var(--amber); }
.status-final.pre_contract { background: var(--status-pre-contract-bg); color: var(--navy); }
.status-final.sold { background: var(--status-sold-bg); color: var(--rosso-base); }
.status-final.available { background: var(--status-available-bg); color: var(--emerald); }

/* ================= CONTENT ================= */

.panel-scroll-final {
    padding: 16px 28px 20px;
    background: #ffffff;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.info-list-final {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.list-item {
    padding: 10px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--gold-accent) 14%, transparent);
}

.list-item label {
    display: block;
    margin-bottom: 4px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--text-label);
}

.list-item .val {
    display: block;
    padding-top: 2px;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
}

.list-item .val.info-val {
    overflow: hidden;
    white-space: nowrap;
}

.list-item .val.info-val .val-track {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

.list-item .val.info-val.is-marquee .val-track {
    animation: panel-info-marquee var(--marquee-duration, 10s) linear infinite;
    animation-delay: 1.2s;
}

/* ================= PRICE — FULL GREEN ================= */

.price-item .price-val,
.price-item .price-val *,
#panel-price {
    font-size: 1.52rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 0 rgba(255,255,255,0.62);
    color: var(--emerald) !important;
}

.list-item.price-item {
    margin-top: 8px;
    padding-top: 15px;
    border-top: 1px solid color-mix(in srgb, var(--gold-accent) 12%, transparent);
}

@keyframes panel-info-marquee {
    0%, 14% {
        transform: translateX(0);
    }
    86%, 100% {
        transform: translateX(calc(-1 * var(--marquee-shift, 0px)));
    }
}

/* ================= ACTION BUTTONS ================= */

.panel-actions-container {
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid color-mix(in srgb, var(--gold-accent) 12%, transparent);
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.panel-actions-container.is-dense {
    gap: 6px;
}

.panel-history-wrap {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 18px;
    background: var(--surface-elevated);
    border: 1px solid var(--surface-border);
}

.panel-history-wrap.hidden {
    display: none;
}

.panel-history-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--panel-neutral-text);
    margin-bottom: 10px;
}

.panel-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel-history-item {
    padding: 8px 10px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid color-mix(in srgb, var(--gold-accent) 14%, transparent);
}

.panel-history-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: .72rem;
    color: var(--panel-neutral-text);
    margin-bottom: 4px;
}

.panel-history-change {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* =========================================================
   🍎 APPLE-GRADE BUTTON
   ========================================================= */

.panel-actions-container .btn-action-new {
    height: 46px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: var(--surface-primary);
    border: 1px solid currentColor;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    cursor: pointer;

    /* 🍎 subtle depth */
    box-shadow: none;

    transition:
        transform .12s ease,
        box-shadow .18s ease,
        background .18s ease,
        filter .18s ease;
}

.panel-actions-container.is-dense .btn-action-new {
    height: 40px;
    border-radius: 18px;
    font-size: 0.82rem;
}

/* 🍎 hover lift */

.panel-actions-container .btn-action-new:hover {
    transform: translateY(-1px);
    filter: none;
    box-shadow: var(--shadow-soft);
}

/* 🍎 press physics */

.panel-actions-container .btn-action-new:active {
    transform: translateY(0.5px) scale(0.995);
    box-shadow: var(--shadow-press);
}

/* 🍎 focus ring (çok premium) */

.panel-actions-container .btn-action-new:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--surface-ring);
}

/* ===== STATUS COLORS (korundu) ===== */

.btn-action-new.reserve {
    color: var(--status-reserved-text);
    border-color: var(--status-reserved-text);
}

.btn-action-new.pre_contract {
    color: var(--status-pre-contract-text);
    border-color: var(--status-pre-contract-text);
}

.btn-action-new.sold-btn {
    color: var(--status-sold-text);
    border-color: var(--status-sold-text);
}

/* ===== ✅ SADECE UNLOCK GRİ ===== */

.btn-action-new.neutral {
    color: var(--panel-neutral-text) !important;
    border-color: var(--panel-neutral-border) !important;
}

.btn-action-new.neutral:hover {
    background: var(--surface-muted) !important;
}

/* ===== ❌ LOCK ICON GLOBAL KILL ===== */

.btn-action-new svg,
.btn-action-new .btn-lock-icon {
    display: none !important;
}

/* ================= FOOTER ================= */

.panel-footer {
    height: 54px;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 22px;

    border-top: 1px solid color-mix(in srgb, var(--gold-accent) 16%, transparent);
    background: var(--panel-cap-surface, linear-gradient(180deg, rgba(255,255,255,0.985), rgba(251,248,242,0.94)));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.footer-icon {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--panel-neutral-text);

    display: flex;
    align-items: center;
    justify-content: center;

    transition: color .2s ease;
}

.footer-icon:hover {
    color: var(--gold-accent);
}

.footer-icon:hover .footer-svg path {
    stroke: var(--gold-accent) !important;
}

/* ================= SPINNER ================= */

.apple-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-action-new.loading {
    pointer-events: none;
    opacity: 0.95;
}

.panel-actions-container.processing .btn-action-new {
    pointer-events: none;
    opacity: 0.42;
    filter: saturate(0.82);
    transform: none !important;
}

.panel-actions-container.processing .btn-action-new.loading {
    opacity: 1;
    filter: none;
}

/* ================= HARD UNLOCK ONLY ================= */

/* SADECE Unlock Parcel gri olacak */
.panel-actions-container .btn-action-new.neutral {
    color: var(--panel-neutral-text) !important;
    border-color: var(--panel-neutral-border) !important;
}

/* hover da gri kalsın */
.panel-actions-container .btn-action-new.neutral:hover {
    background: linear-gradient(180deg, var(--surface-elevated) 0%, var(--surface-muted) 100%) !important;
}

/* =========================================================
   📱 MOBILE BOTTOM SHEET — CONSOLIDATED
   ========================================================= */

@media (max-width: 768px) {

    /* ===== PANEL MODE ===== */

    .side-panel {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;

        width: 100%;
        height: min(64svh, 520px);
        max-height: calc(100svh - 10px);

        border-radius: 24px 24px 0 0;
        border-left: none;
        border-top: 1px solid var(--surface-border);

        opacity: 1;
        filter: none;
        transform: translateY(100%);
        transition: transform .35s cubic-bezier(.2,.8,.2,1);
    }

    .side-panel.open {
        transform: translateY(0);
    }

    .panel-header-final::before {
        content: "";
        display: block;
        width: 52px;
        height: 5px;
        margin: 0 auto 12px;
        border-radius: 999px;
        background: #d4cdbf;
        box-shadow: none;
    }

    /* ===== TYPOGRAPHY SCALE ===== */

    #panel-lot-id,
    #panel-apartment-id {
        font-size: 1.4rem;
    }

    .list-item .val {
        font-size: 0.88rem;
    }

    .status-final {
        margin-top: 10px;
        font-size: 0.68rem;
        padding: 5px 12px;
    }

    .panel-top-row {
        font-size: 0.64rem;
        letter-spacing: .12em;
    }

    .badge-bulk {
        padding: 5px 10px;
        font-size: .68rem;
    }

    /* ===== BUTTON SCALE ===== */

    .panel-actions-container .btn-action-new {
        height: 42px;
        border-radius: 20px;
        font-size: 0.8rem;
    }

    .panel-actions-container.is-dense .btn-action-new {
        height: 36px;
        border-radius: 16px;
        font-size: 0.74rem;
    }

    .panel-actions-container {
        gap: 6px;
        margin-top: 14px;
    }

    /* ===== SPACING & SCROLL ===== */

    .panel-scroll-final {
        padding: 10px 16px 12px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        min-height: 0;
    }

    .panel-header-final {
        padding: 12px 16px 10px;
        flex-shrink: 0;
        touch-action: pan-y;
    }

    .lot-row-final {
        margin-top: 8px;
    }

    .list-item {
        padding: 7px 0;
    }

    .list-item label {
        font-size: .64rem;
        letter-spacing: .07em;
    }

    #panel-price,
    .price-item .price-val,
    .price-item .price-val * {
        font-size: 1.18rem;
    }

    .panel-footer {
        position: static;
        min-height: 54px;
        height: 54px;
        padding: 0 16px;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 4px);
        margin-bottom: 0;
        flex-shrink: 0;
        align-self: end;
    }

    .footer-icon {
        width: 34px;
        height: 34px;
    }

    .footer-svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .lot-row-final {
        align-items: flex-start;
        gap: 8px;
    }

    .badge-bulk {
        margin-top: 2px;
    }

    #panel-lot-id,
    #panel-apartment-id {
        font-size: 1.24rem;
    }

    .panel-scroll-final {
        padding-inline: 14px;
    }
}

.side-panel.hidden{
display:none !important;
}
