/* ==========================================================================
   Alpha Optical — Dynamic Brands Page (RTL / Arabic Styling)
   ========================================================================== */

/* 1. Global Section Container Styles (RTL Mirrored) */
.alpha-brand-section {
    width: 100%;
    padding: 120px 0;
    color: #1A2A38;
    box-sizing: border-box;
    direction: rtl; /* Force RTL direction */
    text-align: right; /* Default text alignment */
    transition: background-color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Font Family Toggles */
.alpha-brand-section.alpha-font-custom {
    font-family: 'Cairo', sans-serif;
}

.alpha-brand-section.alpha-font-theme {
    font-family: inherit;
}

.alpha-brand-section * {
    box-sizing: border-box;
}

.alpha-section-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 60px;
}

/* Alternate Section Styles */
.alpha-brand-section.alpha-bg-white {
    background-color: #FFFFFF;
}

.alpha-brand-section.alpha-bg-cream {
    background-color: #FCF6ED;
}

/* 2. Elegant Section Header (RTL Mirrored) */
.alpha-section-header {
    margin-bottom: 70px;
}

.alpha-section-meta {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em; /* Adjusted letter spacing for Arabic text */
    color: #1A2A38;
    opacity: 0.6;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Scoped Custom Fonts */
.alpha-font-custom .alpha-section-meta {
    font-family: 'Cairo', sans-serif;
}

.alpha-section-separator {
    font-weight: 300;
    opacity: 0.5;
}

.alpha-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 80px;
    flex-wrap: wrap;
    flex-direction: row; /* Handled automatically by RTL */
}

.alpha-section-title {
    font-size: 64px;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    color: #1A2A38;
    letter-spacing: 0;
}

.alpha-font-custom .alpha-section-title {
    font-family: 'Amiri', 'Cairo', Georgia, serif;
}

.alpha-section-desc {
    max-width: 440px;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.75;
    margin: 0;
    color: #1A2A38;
    opacity: 0.8;
}

.alpha-font-custom .alpha-section-desc {
    font-family: 'Cairo', sans-serif;
}

/* 3. The Grid & Cell Border System (Premium RTL Mirrored, No Double Borders) */
.alpha-brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    /* Grid Container has top and right borders in RTL */
    border-top: 1px solid rgba(26, 42, 56, 0.12);
    border-right: 1px solid rgba(26, 42, 56, 0.12);
    border-left: none;
    margin-top: 40px;
}

.alpha-brand-cell-link {
    text-decoration: none;
    color: inherit;
    display: block;
    outline: none;
}

.alpha-brand-cell {
    aspect-ratio: 1 / 0.58;
    min-height: 160px;
    /* Cells have left and bottom borders in RTL */
    border-left: 1px solid rgba(26, 42, 56, 0.12);
    border-bottom: 1px solid rgba(26, 42, 56, 0.12);
    border-right: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    position: relative;
    background-color: transparent;
    transition: background-color 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}

/* 4. Sequenced Brand Numbers */
.alpha-brand-number {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #1A2A38;
    opacity: 0.4;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.alpha-font-custom .alpha-brand-number {
    font-family: 'Cairo', sans-serif;
}

/* 5. Brand Visual Elements (Logo / Text Name) */
.alpha-brand-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Premium Arabic Text Logo */
.alpha-brand-name {
    font-size: 26px;
    font-weight: 700;
    color: #1A2A38;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
}

.alpha-font-custom .alpha-brand-name {
    font-family: 'Amiri', Georgia, serif;
}

/* Premium Image Logo (Same luxury hover defaults) */
.alpha-brand-logo {
    max-width: 65%;
    max-height: 52px;
    object-fit: contain;
    opacity: 0.65;
    filter: grayscale(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: center center;
}

/* 6. Advanced Hover Micro-Animations (RTL) */
.alpha-brand-cell-link:hover .alpha-brand-cell {
    background-color: rgba(26, 42, 56, 0.02); /* Elegant, soft darkening */
    box-shadow: inset 0 0 0 1px rgba(26, 42, 56, 0.04);
}

/* Cream bg hover overrides */
.alpha-bg-cream .alpha-brand-cell-link:hover .alpha-brand-cell {
    background-color: rgba(26, 42, 56, 0.03);
}

.alpha-brand-cell-link:hover .alpha-brand-number {
    opacity: 0.7;
    transform: translate(-50%, -2px);
}

/* Hover Logo: Bring to full color and scale up softly */
.alpha-brand-cell-link:hover .alpha-brand-logo {
    opacity: 1.0;
    filter: grayscale(0%);
    transform: scale(1.07);
}

/* Hover Text-only Logo: elegant gold/accent shift and subtle lift */
.alpha-brand-cell-link:hover .alpha-brand-name {
    color: #bfa15f; /* Elegant Champagne Gold accent */
    transform: translateY(-4px);
}

/* 7. Empty Directory fallback styling */
.alpha-empty-grid {
    grid-column: 1 / -1;
    padding: 80px 40px;
    text-align: center;
    font-size: 15px;
    font-weight: 300;
    opacity: 0.5;
    color: #1A2A38;
}

.alpha-font-custom .alpha-empty-grid {
    font-family: 'Cairo', sans-serif;
}

/* 8. Fallback Inheritance for Theme Fonts */
.alpha-brand-section.alpha-font-theme,
.alpha-brand-section.alpha-font-theme *,
.alpha-font-theme .alpha-section-meta,
.alpha-font-theme .alpha-section-title,
.alpha-font-theme .alpha-section-desc,
.alpha-font-theme .alpha-brand-number,
.alpha-font-theme .alpha-brand-name,
.alpha-font-theme .alpha-empty-grid {
    font-family: inherit !important;
}

/* ==========================================================================
   9. Responsive Design & Media Queries (RTL Mirrored)
   ========================================================================== */

/* Large Tablets & Small Laptops */
@media (max-width: 1200px) {
    .alpha-brand-section {
        padding: 100px 0;
    }
    .alpha-section-inner {
        padding: 0 40px;
    }
    .alpha-section-title {
        font-size: 54px;
    }
    .alpha-brand-name {
        font-size: 24px;
    }
}

/* Medium Tablets */
@media (max-width: 1024px) {
    .alpha-brands-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .alpha-section-title-row {
        gap: 40px;
    }
    .alpha-section-title {
        font-size: 44px;
    }
    .alpha-section-desc {
        max-width: 100%;
    }
}

/* Portrait Tablets & Large Phones */
@media (max-width: 768px) {
    .alpha-brand-section {
        padding: 80px 0;
    }
    .alpha-section-inner {
        padding: 0 30px;
    }
    .alpha-brands-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .alpha-section-title {
        font-size: 38px;
    }
    .alpha-brand-cell {
        aspect-ratio: 1 / 0.65;
        padding: 30px 16px;
    }
}

/* Small Smart Phones (1 Column layout adjustment) */
@media (max-width: 480px) {
    .alpha-brand-section {
        padding: 60px 0;
    }
    .alpha-section-inner {
        padding: 0 20px;
    }
    
    .alpha-brands-grid {
        grid-template-columns: 1fr;
        border-right: none;
        border-left: none;
    }
    
    .alpha-brand-cell {
        aspect-ratio: auto;
        height: 120px;
        padding: 24px 16px;
        border-left: 1px solid rgba(26, 42, 56, 0.12);
        border-right: 1px solid rgba(26, 42, 56, 0.12);
    }
    
    /* Reset borders on 1-column layouts to keep outline consistent in RTL */
    .alpha-brands-grid {
        border-left: 1px solid rgba(26, 42, 56, 0.12);
        border-right: 1px solid rgba(26, 42, 56, 0.12);
    }
    
    .alpha-section-title {
        font-size: 32px;
    }
    .alpha-brand-name {
        font-size: 22px;
    }
}
