:root {
    --primary: #3a93cb;
    --primary-dark: #2c7bb0;
    --accent-red: #ce2424;
    --bg-light: #f8fafc;
    --bg-off-white: #f1f5f9;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --card-bg: #ffffff;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", sans-serif;
    color: var(--text-main);
    background: radial-gradient(circle at top, #eef6ff 0%, #f8fbff 35%, #f1f5f9 100%);
}

.offers-page {
    min-height: 100vh;
}

.offers-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 24px 10px;
}

.header-shell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: rgba(255, 255, 255, 0.88);
    border-radius: 22px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-soft);
    padding: 18px 24px;
    backdrop-filter: blur(14px);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-block img {
    height: 44px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 30px rgba(58, 147, 203, 0.3);
}

.action-primary:hover {
    background: var(--primary-dark);
}

.action-outline {
    background: transparent;
    color: var(--text-main);
    border-color: var(--border-light);
}

.action-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}


.offers-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px 40px;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

.panel-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: var(--shadow-card);
}

.panel-card.sidebar-panel {
    position: sticky;
    top: 110px;
}

.panel-card.viewer-panel {
    padding: 18px;
}

.list-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.search-field input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    width: 100%;
    height: 20px;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.filter-row select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: #fff;
    font-size: 13px;
    height: 40px;
}

.offers-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 640px;
    overflow: auto;
    padding-right: 6px;
}

.offers-list::-webkit-scrollbar {
    width: 6px;
}

.offers-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.4);
    border-radius: 999px;
}

.offer-card {
    border: 1px solid transparent;
    background: #fff;
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    position: relative;
}

.offer-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 16px;
    bottom: 16px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.2s ease;
}

.offer-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.offer-card.is-active {
    border-color: rgba(58, 147, 203, 0.45);
    background: linear-gradient(135deg, rgba(58, 147, 203, 0.1), rgba(255, 255, 255, 0.9));
}

.offer-card.is-active::before {
    background: var(--primary);
}

.offer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.offer-title {
    font-weight: 700;
    font-size: 15px;
}

.offer-code {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.offer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.offer-tag {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 999px;
    font-weight: 600;
}

.offer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}

.empty-state {
    border: 1px dashed rgba(148, 163, 184, 0.6);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.viewer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.viewer-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}

.viewer-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.viewer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}


.viewer-frame {
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    width: 100%;
    aspect-ratio: 1 / 1.414;
    height: auto;
    max-height: 80vh;
    min-height: 680px;
    position: relative;
}

.viewer-frame iframe {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.viewer-frame.is-loading iframe {
    opacity: 0;
}

.viewer-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.viewer-loader.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.loader-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(58, 147, 203, 0.25);
    border-top-color: var(--primary);
    animation: loader-spin 0.9s linear infinite;
}

.loader-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

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

.viewer-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.icon-14 { font-size: 14px; }
.icon-16 { font-size: 16px; }
.icon-18 { font-size: 18px; }
.icon-20 { font-size: 20px; }
.icon-24 { font-size: 24px; }

@media (max-width: 1200px) {
    .offers-content {
        grid-template-columns: 1fr;
    }

    .panel-card.sidebar-panel {
        position: static;
    }

    .offers-list {
        max-height: none;
    }

    .viewer-frame {
        max-height: none;
        min-height: 520px;
    }
}

@media (max-width: 768px) {
    .offers-header,
    .offers-hero,
    .offers-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-shell {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-title {
        font-size: 26px;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .viewer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .viewer-frame {
        min-height: 420px;
    }
}
