/* Tonalux – Deals Page Styles */

/* ─── Hero ──────────────────────────────────────────────────────────────────── */

.deals-hero {
    position: relative;
    padding: 96px 40px 48px;
    text-align: center;
    overflow: hidden;
}

.deals-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(74, 158, 255, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.deals-hero-content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.deals-hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.deals-hero-content p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 500px;
}

.deals-update-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ─── Newsletter strip ───────────────────────────────────────────────────────── */

.deals-newsletter-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 40px;
    background: rgba(74, 158, 255, 0.05);
    border-top: 1px solid rgba(74, 158, 255, 0.12);
    border-bottom: 1px solid rgba(74, 158, 255, 0.12);
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.deals-newsletter-strip-form {
    display: flex;
    gap: 8px;
}

.deals-newsletter-strip input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 5px 12px;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-family: inherit;
    outline: none;
    width: 180px;
    transition: border-color 0.2s;
}

.deals-newsletter-strip input:focus { border-color: var(--accent); }

.deals-newsletter-strip button {
    background: var(--accent-glow);
    border: 1px solid rgba(74,158,255,0.25);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 5px 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    white-space: nowrap;
}

.deals-newsletter-strip button:hover {
    background: rgba(74,158,255,0.2);
}

/* ─── Controls ──────────────────────────────────────────────────────────────── */

/* Neutral band — same background as the deals list below */
.all-deals-band {
    background: transparent;
}

.deals-controls {
    position: sticky;
    top: 64px;
    z-index: 50;
    background: rgba(8, 9, 12, 0.92);
    backdrop-filter: blur(12px);
    padding: 0;
    animation: dealsFadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.18s backwards;
}

.deals-toolbar > * {
    animation: searchFadeIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}
.deals-toolbar > *:nth-child(1) { animation-delay: 0.25s; }
.deals-toolbar > *:nth-child(2) { animation-delay: 0.30s; }
.deals-toolbar > *:nth-child(3) { animation-delay: 0.35s; }
.deals-toolbar > *:nth-child(4) { animation-delay: 0.40s; }

@keyframes dealsFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes searchFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.deals-section {
    padding-left: 40px;
    padding-right: 40px;
    padding-top: 36px;
}

/* Toolbar: search + dropdowns in one row */
.deals-toolbar {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 40px;
    flex-wrap: wrap;
}

/* Search */
.deals-search-wrap {
    position: relative;
    flex: 1;
    min-width: 160px;
}

.search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

.deals-search {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 5px 12px 5px 34px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s;
    outline: none;
    height: 32px;
}

.deals-search::placeholder { color: var(--text-muted); }
.deals-search:focus { border-color: var(--accent); }

/* Shared select style */
.deals-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 28px 0 10px;
    height: 32px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    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='%235c6370' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.2s;
    flex-shrink: 0;
    min-width: 0;
}

.deals-select:focus { border-color: var(--accent); }

/* Count bar */
.deals-count-bar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px 4px;
}

.deals-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Grid ──────────────────────────────────────────────────────────────────── */

.deals-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 40px 60px;
    min-height: 1200px;
}

.deals-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ─── Deal Card ─────────────────────────────────────────────────────────────── */

.deal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.deal-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Image */
.deal-card-image {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--bg-secondary);
    overflow: hidden;
}

.deal-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: transform 0.3s;
}

.deal-card:hover .deal-card-image img { transform: scale(1.03); }

.deal-card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.05em;
}

/* Badges */
.deal-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge-discount {
    background: var(--accent);
    color: #fff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
}

.badge-discount.big { background: #22c55e; }  /* ≥40% */
.badge-discount.medium { background: var(--accent); }  /* 20–39% */
.badge-discount.small { background: var(--text-muted); }  /* <20% */

.badge-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 3px 7px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.badge-affiliate {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-direct {
    background: rgba(156, 163, 176, 0.1);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Body */
.deal-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.deal-card-category {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.deal-card-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
}

.deal-card-developer {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Pricing */
.deal-card-pricing {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.deal-price-sale {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.deal-price-original {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.deal-price-currency {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
}

.deal-price-discount-only {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.02em;
}

/* Sale end */
.deal-card-end {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.deal-card-end.urgent { color: #f87171; }

/* ─── Loading ────────────────────────────────────────────────────────────────── */

.deals-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 80px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ─── Empty State ────────────────────────────────────────────────────────────── */

.deals-empty {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    text-align: center;
}

.deals-empty svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

.deals-empty p { font-size: 0.95rem; }

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── Disclosure ─────────────────────────────────────────────────────────────── */

.deals-disclosure {
    border-top: 1px solid var(--border);
    padding: 20px 40px;
}

.disclosure-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.disclosure-inner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.5;
}

.disclosure-inner strong { color: var(--text-secondary); }

/* ─── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
    .deals-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
    .deals-hero { padding: 100px 20px 48px; }

    .deals-controls { top: 56px; }

    .deals-toolbar {
        padding: 10px 16px;
        gap: 8px;
    }

    /* Search takes full width first row */
    .deals-search-wrap { flex: 1 1 100%; }

    /* Three dropdowns share the second row */
    .deals-select { flex: 1 1 0; font-size: 0.8rem; }

    .deals-count-bar { padding: 0 16px 10px; }

    .deals-section { padding: 24px 16px 60px; }

    .deals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .deals-disclosure { padding: 16px; }
}

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

/* ─── Featured Deals of the Week ────────────────────────────────────────────── */

.featured-section {
    background:
        radial-gradient(ellipse 80% 100% at 50% 0%, rgba(245,158,11,0.055) 0%, rgba(245,158,11,0.02) 45%, transparent 85%);
    padding: 32px 0 60px;
}

.featured-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

.featured-header {
    text-align: center;
    margin-bottom: 28px;
}

.featured-label {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.featured-title {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    min-height: 340px;
}

.featured-card {
    background: var(--bg-card);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.featured-card:hover {
    border-color: rgba(245, 158, 11, 0.6);
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(245,158,11,0.15);
}

.featured-card-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: transform 0.3s;
}

.featured-card:hover .featured-card-img img { transform: scale(1.05); }

.featured-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f59e0b;
    color: #000;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: 0.04em;
}

.featured-badge.free {
    background: #22c55e;
}

.featured-card-body {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-top: 1px solid var(--border);
}

.featured-card-dev {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.featured-card-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}

.featured-card-price {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.featured-price-sale {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #22c55e;
}

.featured-price-orig {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.featured-price-pct {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: #f59e0b;
    margin-left: auto;
}

/* ─── All Deals divider ──────────────────────────────────────────────────────── */

.all-deals-header {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 40px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: dealsFadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.08s backwards;
}

.all-deals-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.all-deals-header .deals-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.all-deals-line { display: none; }

.all-deals-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

@media (max-width: 1100px) {
    .featured-grid { grid-template-columns: repeat(3, 1fr); min-height: 620px; }
}

@media (max-width: 768px) {
    .featured-inner { padding: 0 16px; }
    .featured-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; min-height: 900px; }
    .all-deals-header { padding: 20px 16px 0; }
}

@media (max-width: 480px) {
    .featured-grid { grid-template-columns: 1fr; min-height: auto; }
}
