/**
 * Altındost Kuyumculuk — modern fiyat panosu
 * Orantı: 8px grid · Manrope (arayüz) + Outfit (fiyat rakamları)
 */

:root {
    --u: 8px;
    --s-1: calc(var(--u) * 0.5);
    --s-2: var(--u);
    --s-3: calc(var(--u) * 1.5);
    --s-4: calc(var(--u) * 2);
    --s-5: calc(var(--u) * 3);
    --s-6: calc(var(--u) * 4);
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --r-pill: 9999px;
    --brand: #723d2b;
    --brand-mid: #8b4d3a;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --font: "Manrope", system-ui, sans-serif;
    --font-price: "Outfit", "Manrope", system-ui, sans-serif;
}

body.theme-light {
    --canvas: #f4f2ef;
    --canvas-2: #ebe8e4;
    --elev-1: rgba(255, 255, 255, 0.72);
    --elev-2: #ffffff;
    --ink: #121110;
    --ink-2: #45403c;
    --ink-3: #78716c;
    --line: rgba(18, 17, 16, 0.08);
    --line-strong: rgba(18, 17, 16, 0.12);
    --shadow-1: 0 1px 2px rgba(18, 17, 16, 0.04);
    --shadow-2: 0 12px 40px rgba(18, 17, 16, 0.08);
    --header-bg: rgba(255, 255, 255, 0.78);
    --product: #78716c;
    --live: #047857;
    --live-ring: rgba(4, 120, 87, 0.25);
    --err: #dc2626;
    --flash-up: rgba(16, 185, 129, 0.45);
    --flash-down: rgba(248, 113, 113, 0.45);
    --flash-up-fill: rgba(16, 185, 129, 0.14);
    --flash-up-fill-mid: rgba(16, 185, 129, 0.08);
    --flash-up-outer: rgba(16, 185, 129, 0.22);
    --flash-down-fill: rgba(248, 113, 113, 0.14);
    --flash-down-fill-mid: rgba(248, 113, 113, 0.08);
    --flash-down-outer: rgba(248, 113, 113, 0.22);
    --flash-up-text: #047857;
    --flash-down-text: #b91c1c;
    --flash-peak-up: #15803d;
    --flash-peak-down: #dc2626;
    --glass-edge: rgba(255, 255, 255, 0.6);
    --ambient-a: rgba(114, 61, 43, 0.09);
    --ambient-b: rgba(13, 148, 136, 0.07);
    --ambient-c: rgba(99, 102, 241, 0.05);
}

body.theme-dark {
    --canvas: #090807;
    --canvas-2: #12100e;
    --elev-1: rgba(24, 22, 20, 0.75);
    --elev-2: #181614;
    --ink: #f5f2ee;
    --ink-2: #c4bbb2;
    --ink-3: #8a827a;
    --line: rgba(245, 242, 238, 0.07);
    --line-strong: rgba(245, 242, 238, 0.11);
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    --shadow-2: 0 16px 48px rgba(0, 0, 0, 0.55);
    --header-bg: rgba(15, 13, 12, 0.82);
    --product: #a39a91;
    --live: #4ade80;
    --live-ring: rgba(74, 222, 128, 0.28);
    --err: #f87171;
    --flash-up: rgba(52, 211, 153, 0.45);
    --flash-down: rgba(248, 113, 113, 0.45);
    --flash-up-fill: rgba(52, 211, 153, 0.14);
    --flash-up-fill-mid: rgba(52, 211, 153, 0.07);
    --flash-up-outer: rgba(52, 211, 153, 0.2);
    --flash-down-fill: rgba(248, 113, 113, 0.14);
    --flash-down-fill-mid: rgba(248, 113, 113, 0.07);
    --flash-down-outer: rgba(248, 113, 113, 0.2);
    --flash-up-text: #6ee7b7;
    --flash-down-text: #fca5a5;
    --flash-peak-up: #4ade80;
    --flash-peak-down: #f87171;
    --glass-edge: rgba(255, 255, 255, 0.06);
    --ambient-a: rgba(114, 61, 43, 0.35);
    --ambient-b: rgba(45, 212, 191, 0.08);
    --ambient-c: rgba(129, 140, 248, 0.06);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(14px, 0.35vw + 13px, 16px);
}

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    line-height: 1.4;
}

/* ——— Yerleşim kabuğu ——— */
.container.layout {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    max-width: min(1680px, 100%);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    padding-inline: clamp(var(--s-2), 2vw, var(--s-5));
    padding-bottom: var(--s-4);
}

.ambient {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ambient::before,
.ambient::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.85;
}

.ambient::before {
    width: min(90vw, 720px);
    height: min(90vw, 720px);
    top: -18%;
    right: -12%;
    background: radial-gradient(circle at 30% 30%, var(--ambient-a), transparent 70%);
}

.ambient::after {
    width: min(70vw, 520px);
    height: min(70vw, 520px);
    bottom: -8%;
    left: -8%;
    background: radial-gradient(circle at 50% 50%, var(--ambient-b), var(--ambient-c), transparent 65%);
}

.header,
.main-content,
.footer {
    position: relative;
    z-index: 1;
}

/* ——— Üst bar ——— */
.header {
    flex-shrink: 0;
    margin-top: var(--s-3);
    margin-bottom: var(--s-2);
    padding: var(--s-3) var(--s-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    flex-wrap: wrap;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    backdrop-filter: blur(20px) saturate(1.2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1), var(--shadow-2);
}

.header::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 1px 0 var(--glass-edge);
    pointer-events: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    min-width: 0;
    flex-wrap: wrap;
}

.header-badges {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex-wrap: wrap;
}

.logo {
    height: clamp(2.5rem, 1.5rem + 2.5vw, 3.25rem);
    width: auto;
    object-fit: contain;
    border-radius: var(--r-sm);
    box-shadow: none;
}

body.theme-dark .logo {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand-info {
    min-width: 0;
}

.brand-name {
    font-size: clamp(1.05rem, 0.9rem + 0.9vw, 1.45rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    background: linear-gradient(120deg, var(--ink) 0%, var(--ink-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.theme-dark .brand-name {
    background: linear-gradient(120deg, #fff 0%, var(--ink-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.brand-subtitle {
    margin-top: var(--s-1);
    font-size: clamp(0.65rem, 0.55rem + 0.35vw, 0.75rem);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--brand-mid);
}

body.theme-dark .brand-subtitle {
    color: rgba(245, 242, 238, 0.55);
}

.header-phone-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-pill);
    font-size: clamp(0.68rem, 0.62rem + 0.25vw, 0.78rem);
    font-weight: 700;
    text-decoration: none;
    color: var(--ink-2);
    background: var(--elev-2);
    border: 1px solid var(--line);
    white-space: nowrap;
    transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}

.header-phone-badge:hover {
    border-color: rgba(114, 61, 43, 0.35);
    transform: translateY(-1px);
}

.header-phone-badge i {
    color: var(--brand);
    font-size: 0.9em;
}

.header-connection-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-pill);
    font-size: clamp(0.62rem, 0.58rem + 0.2vw, 0.72rem);
    font-weight: 800;
    letter-spacing: 0.08em;
}

.header-connection-badge--live {
    color: var(--live);
    background: var(--elev-2);
    border: 1px solid var(--live-ring);
}

.header-connection-badge--live .badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.2);
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.92); }
}

.header-connection-badge--error {
    color: var(--err);
    background: var(--elev-2);
    border: 1px solid rgba(220, 38, 38, 0.35);
}

.header-connection-badge--error .badge-dot {
    display: none;
}

.header-connection-badge .badge-icon {
    display: none;
}

.header-connection-badge--error .badge-icon {
    display: inline-flex;
}

.header-connection-badge--error .badge-icon svg {
    width: 14px;
    height: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    flex-shrink: 0;
}

.btn {
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-sm);
    font-family: var(--font);
    font-weight: 700;
    font-size: clamp(0.65rem, 0.6rem + 0.22vw, 0.78rem);
    border: 1px solid var(--line);
    background: var(--elev-2);
    color: var(--ink-2);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    transition: border-color 0.2s var(--ease-out), color 0.2s, box-shadow 0.2s;
}

.btn:hover {
    border-color: var(--line-strong);
    color: var(--ink);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.btn-toggle-list {
    background: linear-gradient(135deg, var(--brand) 0%, #4e2a20 100%);
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(114, 61, 43, 0.35);
}

.btn-toggle-list:hover {
    filter: brightness(1.06);
    color: #fff !important;
}

.btn-fullscreen,
.btn-user {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: var(--r-sm);
}

.btn-fullscreen svg {
    width: 18px;
    height: 18px;
    stroke: var(--ink-2);
}

.btn-fullscreen:hover svg {
    stroke: var(--brand);
}

.btn-user i {
    color: var(--ink-2);
}

/* ——— Ana grid ——— */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    min-height: 0;
    padding-bottom: var(--s-3);
    overflow: hidden;
}

.price-list-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(var(--s-3), 1.5vw, var(--s-5));
    align-items: start;
    align-content: start;
    flex: 0 0 auto;
    width: 100%;
}

.price-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
    align-self: start;
    background: var(--elev-1);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1), var(--shadow-2);
    overflow: hidden;
    transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.price-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-1), 0 20px 50px rgba(0, 0, 0, 0.1);
}

body.theme-dark .price-card:hover {
    box-shadow: var(--shadow-1), 0 24px 60px rgba(0, 0, 0, 0.5);
}

.price-card-header {
    flex-shrink: 0;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(114, 61, 43, 0.06) 0%, transparent 100%);
}

body.theme-dark .price-card-header {
    background: linear-gradient(180deg, rgba(114, 61, 43, 0.15) 0%, transparent 100%);
}

.price-card-title {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-size: clamp(0.82rem, 0.72rem + 0.45vw, 1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.price-card-icon {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--brand);
    flex-shrink: 0;
}

.price-table-wrapper,
.currency-table-wrapper {
    flex: 0 0 auto;
    padding: var(--s-2) var(--s-3) var(--s-3);
    overflow: visible;
    max-height: none;
}

.price-table,
.currency-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 var(--s-1);
    font-variant-numeric: tabular-nums;
}

.price-table thead th,
.currency-table thead th {
    padding: var(--s-2) var(--s-3);
    font-size: clamp(0.58rem, 0.52rem + 0.2vw, 0.68rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-3);
    border: none;
    vertical-align: middle;
}

.price-table thead th:first-child,
.currency-table thead th:first-child {
    text-align: left;
    width: 34%;
}

.th-alis,
.th-satis {
    text-align: right !important;
    color: var(--ink-3) !important;
    background: transparent !important;
}

.price-table tbody tr,
.currency-table tbody tr {
    background: var(--elev-2);
    border-radius: var(--r-md);
    box-shadow: 0 1px 0 var(--glass-edge) inset;
    outline: 1px solid var(--line);
    outline-offset: -1px;
}

.price-table tbody td,
.currency-table tbody td {
    padding: var(--s-3) var(--s-3);
    vertical-align: middle;
    border: none;
}

.price-table tbody tr td:first-child,
.currency-table tbody tr td:first-child {
    border-radius: var(--r-md) 0 0 var(--r-md);
    padding-left: calc(var(--s-3) + 2px);
    border-left: 3px solid var(--brand);
    box-shadow: inset 0 0 0 1px rgba(114, 61, 43, 0.06);
}

body.theme-dark .price-table tbody tr td:first-child,
body.theme-dark .currency-table tbody tr td:first-child {
    box-shadow: inset 0 0 0 1px rgba(114, 61, 43, 0.2);
}

.price-table tbody tr td:last-child,
.currency-table tbody tr td:last-child {
    border-radius: 0 var(--r-md) var(--r-md) 0;
    padding-right: var(--s-4);
}

.cell-product {
    font-family: var(--font);
    font-size: clamp(0.7rem, 0.6rem + 0.35vw, 0.88rem) !important;
    font-weight: 800 !important;
    letter-spacing: 0.07em !important;
    text-transform: uppercase;
    line-height: 1.25 !important;
    max-width: 42%;
}

body.theme-light .cell-product {
    color: #0f0e0d !important;
}

body.theme-dark .cell-product {
    color: #ece6df !important;
}

body.theme-light .cell-product .currency-name > span:not(.currency-code) {
    color: inherit;
}

.cell-product .currency-name {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.cell-product .currency-name > span:not(.currency-code) {
    font-size: inherit;
    letter-spacing: 0.08em;
}

.currency-flag {
    width: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
    height: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--line);
    flex-shrink: 0;
}

.currency-code {
    font-family: var(--font);
    font-size: 0.58rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(114, 61, 43, 0.1);
    color: var(--brand);
    letter-spacing: 0.04em;
}

body.theme-dark .currency-code {
    background: rgba(114, 61, 43, 0.35);
    color: #f5d0c4;
}

.price-value,
.currency-value {
    font-family: var(--font-price);
    font-size: clamp(1.2rem, 0.85rem + 1.6vw, 2.35rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    line-height: 1.05;
    text-align: right;
    font-variant-numeric: tabular-nums lining-nums;
}

.price-value.alis,
.currency-value.alis,
.price-value.satis,
.currency-value.satis {
    color: var(--ink);
    background: transparent;
    border-left: 1px solid var(--line);
    box-shadow: none;
    transition: color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fiyat değişimi: yalnızca rakam rengi (yükseliş yeşil, düşüş kırmızı) */
.price-value.updated.up,
.currency-value.updated.up {
    animation: price-flash-up 1s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.price-value.updated.down,
.currency-value.updated.down {
    animation: price-flash-down 1s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes price-flash-up {
    0% {
        color: var(--ink);
    }
    10%, 42% {
        color: var(--flash-peak-up);
    }
    100% {
        color: var(--ink);
    }
}

@keyframes price-flash-down {
    0% {
        color: var(--ink);
    }
    10%, 42% {
        color: var(--flash-peak-down);
    }
    100% {
        color: var(--ink);
    }
}

.currency-card {
    grid-column: 1 / -1;
}

/* ——— Footer ——— */
.footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: var(--s-3) var(--s-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--s-3);
    flex-wrap: wrap;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
}

.footer-disclaimer {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    font-size: clamp(0.62rem, 0.58rem + 0.18vw, 0.72rem);
    font-weight: 600;
    color: var(--ink-3);
}

.footer-disclaimer-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    color: var(--brand);
}

.last-update {
    font-family: var(--font);
    font-size: clamp(0.62rem, 0.58rem + 0.18vw, 0.72rem);
    font-weight: 600;
    color: var(--ink-2);
}

.footer.footer--error .footer-disclaimer,
.footer.footer--error .last-update {
    color: var(--err);
}

/* ——— Kapalı görünüm ——— */
.price-list-closed-view {
    display: none;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: var(--s-6) var(--s-4);
}

.price-list-closed-view .closed-view-box {
    position: relative;
    max-width: 440px;
    width: 100%;
    padding: var(--s-6) var(--s-5);
    text-align: center;
    background: var(--elev-1);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-2);
}

.price-list-closed-view .closed-view-box::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(160deg, rgba(114, 61, 43, 0.12), transparent 50%);
    pointer-events: none;
}

.price-list-closed-view .closed-logo {
    position: relative;
    width: min(168px, 42vw);
    height: auto;
    margin-bottom: var(--s-4);
}

.price-list-closed-view .closed-view-divider {
    position: relative;
    width: 48px;
    height: 2px;
    margin: 0 auto var(--s-4);
    border: none;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    opacity: 0.7;
}

.price-list-closed-view .closed-message {
    position: relative;
    font-size: clamp(0.95rem, 0.85rem + 0.4vw, 1.15rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.45;
    color: var(--ink-2);
}

body.price-list-hidden .price-list-content,
body.price-list-hidden .footer {
    display: none !important;
}

body.price-list-hidden .price-list-closed-view {
    display: flex !important;
}

body.price-list-hidden .main-content {
    flex: 1;
}

body.price-list-hidden .header {
    margin-bottom: 0;
}

/* ——— Büyük ekran / TV ——— */
@media (min-width: 1200px) {
    html, body {
        height: 100%;
        overflow: hidden;
    }

    .container.layout {
        height: 100vh;
        max-height: 100vh;
    }

    .main-content {
        overflow: hidden;
    }

    .price-table-wrapper,
    .currency-table-wrapper {
        overflow: visible;
    }
}

@media (max-width: 900px) {
    .price-grid {
        grid-template-columns: 1fr;
    }

    .header {
        margin-top: var(--s-2);
        padding: var(--s-3);
    }

    .cell-product {
        max-width: 44%;
    }
}

@media (max-width: 600px) {
    .brand-subtitle {
        display: none;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .price-card:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .price-card,
    .header-phone-badge,
    .btn {
        transition: none;
    }

    .price-card:hover {
        transform: none;
    }

    .header-connection-badge--live .badge-dot {
        animation: none;
    }

    .price-value.updated,
    .currency-value.updated {
        animation: none !important;
    }
}
