/* =========================================
   1. Font Definitions (Dana)
   ========================================= */
@font-face {
    font-family: "dana";
    src: url("fonts/dana-fanum-regular.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "dana";
    src: url("fonts/dana-fanum-medium.woff2") format("woff2");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "dana";
    src: url("fonts/dana-fanum-demibold.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: "dana";
    src: url("fonts/dana-fanum-bold.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

/* =========================================
   2. Design Tokens & Reset
   ========================================= */
:root {
    --primary-red: #ff3543;
    --primary-red-hover: #e02634;
    --bg-page: #f5f5f5;
    --bg-card: #ffffff;
    --text-primary: #141414;
    --text-muted: #7e7e7e;
    --border-light: #ececec;
    --footer-bg: #343542;
    --max-width: 1400px;
}

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

body {
    font-family: "dana", system-ui, -apple-system, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    direction: rtl;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   3. Adaptive Header & Navigation
   ========================================= */
.main-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.toolbar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.toolbar-brand-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-logo img {
    width: 28px;
    height: auto;
}

.brand-name {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-red);
    letter-spacing: -0.5px;
}

.cinema-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: #f7f7f7;
    color: var(--text-primary);
    border: 1px solid transparent;
}

.cinema-filter-btn:hover {
    background-color: #ffe8e9;
    color: var(--primary-red);
}

.cinema-filter-btn img {
    width: 15px;
}

/* Search Bar */
.search-field {
    display: flex;
    align-items: center;
    background-color: #f5f6f8;
    border-radius: 12px;
    padding: 0.5rem 0.9rem;
    gap: 0.6rem;
    flex: 1;
    max-width: 460px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.search-field:focus-within {
    background-color: #ffffff;
    border-color: #e0e0e0;
    box-shadow: 0 0 0 3px rgba(255, 53, 67, 0.08);
}

.search-field img {
    width: 16px;
    opacity: 0.5;
}

.search-field input {
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    width: 100%;
}

/* User Action Buttons */
.toolbar-user-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.nav-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    color: #333333;
}

.nav-action-btn:hover {
    background-color: #f2f3f5;
}

.nav-action-btn img {
    width: 17px;
    height: 17px;
}

.location-btn .chevron {
    width: 11px;
    margin-right: 0.15rem;
}

.login-btn {
    border: 1px solid var(--border-light);
    background-color: #ffffff;
}

.login-btn:hover {
    border-color: #d8d8d8;
}

/* Horizontal Scrolling Categories */
.categories-nav {
    border-top: 1px solid #f2f2f2;
}

.categories-scroll-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.55rem 1.25rem;
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.categories-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.cat-pill {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.35rem 0.95rem;
    border-radius: 20px;
    color: #555555;
    font-weight: 500;
}

.cat-pill:hover {
    background-color: #f2f3f5;
    color: #111111;
}

.cat-pill.active {
    background-color: #ebecef;
    color: #000000;
    font-weight: 700;
}

/* =========================================
   4. Top Hero Banner
   ========================================= */
.hero-cover-container {
    max-width: var(--max-width);
    margin: 1.5rem auto 0;
    padding: 0 1.25rem;
}

.hero-cover-img {
    width: 100%;
    border-radius: 14px;
}

/* =========================================
   5. Main Two-Column Layout
   ========================================= */
.page-layout {
    max-width: var(--max-width);
    margin: 1.5rem auto;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

/* Content Area (Catalogs & Banners) */
.content-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.promo-banner img {
    width: 100%;
    border-radius: 12px;
}

.media-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.group-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-red);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}

.view-all-link:hover {
    background-color: #ffe6e8;
}

.view-all-link img {
    width: 14px;
}

/* Product Cards Grid */
.media-cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.media-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.media-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.media-card:hover img {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.media-card p {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =========================================
   6. Sidebar (Box Office Rankings)
   ========================================= */
.sales-panel {
    background-color: var(--bg-card);
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 90px;
}

.sales-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.75rem;
}

.sales-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
}

.sales-update {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sales-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.sale-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.35rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
    border-radius: 8px;
}

.sale-item:hover {
    background-color: #fafafa;
}

.sale-thumb {
    width: 54px;
    height: 76px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.sale-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.25rem;
}

.sale-headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.movie-name {
    font-size: 0.875rem;
    font-weight: 600;
}

.box-office {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--primary-red);
    letter-spacing: 0.3px;
}

.director-name {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.view-all-sales {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-red);
    padding: 1rem 0 0.25rem;
}

.view-all-sales img {
    width: 14px;
}

/* =========================================
   7. Footer
   ========================================= */
.main-footer {
    background-color: var(--footer-bg);
    color: #ffffff;
    margin-top: 4rem;
    padding: 1.5rem 0;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.8125rem;
}

.footer-links a {
    opacity: 0.85;
}

.footer-links a:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-socials {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-socials img {
    width: 18px;
    height: 18px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-socials img:hover {
    opacity: 1;
}

/* =========================================
   8. Responsive Breakpoints
   ========================================= */
@media (max-width: 1100px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .sales-panel {
        position: static;
    }

    .media-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .toolbar {
        flex-wrap: wrap;
        gap: 0.75rem;
        padding: 0.65rem 1rem;
    }

    .toolbar-brand-group {
        order: 1;
    }

    .toolbar-user-actions {
        order: 2;
    }

    .search-field {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .btn-text {
        display: none;
    }

    .nav-action-btn {
        padding: 0.5rem;
        border-radius: 50%;
    }

    .location-btn .chevron {
        display: none;
    }

    .media-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 520px) {
    .media-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brand-name {
        font-size: 1.05rem;
    }

    .cinema-filter-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.8rem;
    }
}