/* === CSS Variables === */
:root {
    --primary: #1A237E;
    --secondary: #FB6D00;
    --text-dark: #14213B;
    --text-main: #454652;
    --text-light: #757575;
    --bg-light: #F5F2FB;
    --bg-white: #FBF8FF;
    --border-color: #C6C5D4;
    --success: #4CAF50;
    --transition: 0.3s ease;
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-main);
    background: #FFFCFC;
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Support LTR dynamically */
html[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

/* === Buttons === */
.btn {
    padding: 8px 24px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--secondary);
    color: #FFFCFC;
}
.btn-primary:hover {
    background-color: #e65100;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover {
    background-color: var(--primary);
    color: white;
}

.btn-outline-block {
    width: 100%;
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
    padding: 8px;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-outline-block:hover {
    background-color: var(--primary);
    color: white;
}

/* === Header === */
.header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo img {
    height: 50px;
    object-fit: contain;
}

.main-nav ul {
    display: flex;
    gap: 32px;
}

.main-nav a {
    font-weight: 500;
    color: var(--text-main);
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.main-nav a.active, .main-nav a:hover {
    color: var(--text-dark);
    border-bottom-color: var(--secondary);
    font-weight: 700;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-toggle {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 700;
    font-family: 'Cairo';
}

.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    color: var(--primary);
    cursor: pointer;
}

/* === Hero Section === */
.hero {
    background:
        linear-gradient(135deg, rgba(26, 35, 126, 0.60) 25%, rgba(26, 35, 126, 0.60) 45%, rgba(251, 109, 0,0.60) 100%),
        url('assets/hook-banner-main.png') center center/cover no-repeat;
    color: white;
    padding: 60px 0 80px;
    position: relative;
    overflow: visible;
}

.hero-bg-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12), transparent 24%),
        radial-gradient(circle at 80% 18%, rgba(251, 109, 0, 0.14), transparent 22%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(10, 16, 72, 0.18) 100%);
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hero h1 {
    font-size: 48px;
    line-height: 1.2;
    max-width: 900px;
    text-shadow: 0 6px 18px rgba(0,0,0,0.22);
}

.hero-subtitle {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.92);
    font-weight: 500;
    max-width: 700px;
    text-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.search-box {
    background: var(--bg-white);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 900px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    flex: 1;
    min-width: 200px;
}

.search-input-wrapper input {
    width: 100%;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Cairo';
    font-size: 16px;
    outline: none;
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
}

/* Dropdowns */
.dropdown {
    position: relative;
    min-width: 150px;
}

.dropdown-toggle {
    width: 100%;
    background: white;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cairo';
    justify-content: space-between;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    background: #ffffff;
    border: 1px solid rgba(198, 197, 212, 0.95);
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(20, 33, 59, 0.14);
    width: 100%;
    z-index: 9999;
    display: none;        
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    overflow-y: auto;      
    max-height: 300px;     
    padding: 8px 0;       
} 
html[dir="ltr"] .dropdown-menu {
    right: auto;
    left: 0;
}

.dropdown.active .dropdown-menu {
     display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    transition: var(--transition);
    color: var(--text-dark);
    font-weight: 500;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.search-btn {
    height: 58px;
    padding: 0 40px;
}

.register-link {
    color: #E77624;
    font-weight: 500;
    transition: var(--transition);
}
.register-link:hover {
    color: white;
}

/* === Section Headers === */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 48px;
    border-bottom: 2px solid #E5EEFF;
    padding-bottom: 16px;
}

.section-text h2 {
    color: var(--primary);
    font-size: 24px;
}

.section-text p {
    color: var(--text-light);
    font-size: 16px;
}

.view-all {
    color: #9E4200;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    white-space: nowrap;
}

/* === Categories Section === */
.categories-swiper {
    padding-bottom: 50px !important;
}

.category-card {
    background: white;
    border: 1px solid rgba(193,199,210,0.3);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.category-icon {
    width: 96px;
    height: 96px;
    background: #E5EEFF;
    border-radius: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 32px;
    color: var(--primary);
}

.category-card h3 {
    color: var(--text-dark);
    font-size: 18px;
    margin-bottom: 4px;
}

.category-card span {
    color: var(--text-light);
    font-size: 14px;
}

/* === Company Cards === */
.companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.company-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.company-img {
    height: 200px;
    position: relative;
    background: #eee;
}

.company-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 16px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.badge.verified {
    left: 16px;
    background: rgba(76, 175, 80, 0.9);
    color: white;
}

html[dir="ltr"] .badge.verified {
    left: auto;
    right: 16px;
}

.badge.featured {
    right: 16px;
    background: var(--primary);
    color: white;
    border-radius: 9999px;
}

html[dir="ltr"] .badge.featured {
    right: auto;
    left: 16px;
}

.company-info {
    padding: 24px;
    position: relative;
}

.company-logo {
    width: 64px;
    height: 64px;
    background: #EFECF5;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -48px;
    right: 24px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
}

html[dir="ltr"] .company-logo {
    right: auto;
    left: 24px;
}

.company-logo img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.company-info h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 8px;
}

.company-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.company-rating span {
    color: var(--text-light);
}

.company-info p {
    color: var(--text-light);
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* === Products Grid === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(193,199,210,0.3);
    transition: var(--transition);
}

.product-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.product-img {
    height: 200px;
    position: relative;
    background: #f0f0f0;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.discount-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #D32F2F;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
}

.product-info {
    padding: 16px;
}

.product-info h3 {
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.product-company {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    font-size: 14px;
    color: var(--text-light);
}

.price {
    font-weight: 700;
    color: var(--primary);
}

/* === Articles === */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

.article-card {
    background: white;
    border: 1px solid rgba(193,199,210,0.3);
    padding: 24px;
    border-radius: 12px;
    transition: var(--transition);
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.article-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.article-tags span {
    background: #E5EEFF;
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
}

.article-card h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.article-card p {
    color: var(--text-light);
    font-size: 15px;
}

/* Article thumbnail and read-more button */
.article-card .article-img {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.article-card .article-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}
.article-card:hover .article-img img {
    transform: scale(1.03);
}

.article-card .read-more {
    margin-top: 14px;
    padding: 8px 18px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}
.article-card .read-more:hover {
    background: var(--primary);
    color: white;
}

@media (max-width: 768px) {
    .article-card .article-img {
        height: 200px;
    }
}

/* === Newsletter === */
.newsletter {
    background: var(--text-light);
    color: white;
}

.newsletter-container {
    text-align: center;
    max-width: 700px;
}

.newsletter h2 {
    margin-bottom: 16px;
}

.newsletter p {
    margin-bottom: 32px;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 16px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.newsletter-form input {
    flex: 1;
    border: none;
    padding: 12px;
    font-family: 'Cairo';
    outline: none;
    border-radius: 8px;
}

.form-message {
    margin-top: 12px;
    font-size: 14px;
}

.form-message.error {
    color: #ff6b6b;
}

.form-message.success {
    color: #81c784;
}

/* === Footer === */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.8);
    padding-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
}

.footer h3 {
    color: white;
    font-size: 20px;
    margin-bottom: 20px;
}

.about-col p {
    line-height: 1.8;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul a:hover {
    color: var(--secondary);
    padding-inline-start: 5px;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.contact-info i {
    color: var(--secondary);
    margin-top: 5px;
}

.footer-bottom {
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
}

/* === Mobile Responsiveness === */
@media (max-width: 992px) {
    .hero h1 { font-size: 36px; }
    .hero-subtitle { font-size: 18px; }
    .search-box { flex-direction: column; }
    .search-btn { width: 100%; }
    .dropdown { width: 100%; }
    
    .main-nav {
        position: fixed;
        top: 80px;
        right: -100%; /* RTL off-screen */
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--bg-white);
        flex-direction: column;
        transition: 0.3s;
        z-index: 999;
        padding: 24px;
    }

    html[dir="ltr"] .main-nav {
        right: auto;
        left: -100%;
    }

    .main-nav.active {
        right: 0; /* Show */
    }

    html[dir="ltr"] .main-nav.active {
        left: 0;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 24px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .companies-grid, .products-grid, .articles-grid {
        grid-template-columns: 1fr;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .newsletter-form {
        flex-direction: column;
    }
}