﻿/* Accent tokens approximating H1.jpg */
:root {
    --hp-accent: #e4002b;
    --hp-ribbon: #4b5576;
    --hp-footer: #22262c;
    --hp-footer-text: #cfd3da;
}

/* Header containers */
.gs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* RTL Fix - Prevent negative margin and overflow issues */
[dir="rtl"] body,
[dir="rtl"] html {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Only adjust containers, not .row (keeps Bootstrap negative gutters intact) */
[dir="rtl"] .gs-container,
[dir="rtl"] .container,
[dir="rtl"] .container-fluid {
    margin-right: auto !important;
    margin-left: auto !important;
    padding-inline: 1rem;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Prevent row overflow in RTL */
[dir="rtl"] .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
}

.gs-top-strip {
    background: #5b6b8a;
    color: #fff;
    font-size: 12px;
}

[data-bs-theme="dark"] .gs-top-strip {
    background: #3b465e;
}

.gs-top-strip .gs-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 1rem;
}

.gs-top-link {
    color: #fff;
    text-decoration: none;
    font-size: 12px;
}

    .gs-top-link:hover {
        opacity: .85;
    }

.gs-main-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    overflow: visible !important; /* Critical for dropdowns */
}

.gs-main-header .gs-container {
  overflow: visible !important; /* Critical for dropdowns */
}

/* CRITICAL: Override container overflow for header in RTL to allow dropdowns */
[dir="rtl"] .gs-main-header {
    overflow: visible !important;
}

[dir="rtl"] .gs-main-header .gs-container {
    overflow: visible !important;
}

.gs-header-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.6rem 0;
    flex-wrap: nowrap;
    overflow: visible !important; /* Allow dropdowns to overflow */
}

/* RTL Header Row Fix */
[dir="rtl"] .gs-header-row {
    overflow: visible !important; /* Allow dropdowns to overflow in RTL */
}

.gs-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 20px;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
}

.gs-logo-img {
    height: 65px;
    width: auto;
    display: block;
}

@media (min-width:992px) {
    .gs-logo-img {
        height: 65px;
    }
}
/* Theme logo visibility */
.gs-logo-img--light {
    display: block;
}

.gs-logo-img--dark {
    display: none;
}

[data-bs-theme="dark"] .gs-logo-img--light {
    display: none;
}

[data-bs-theme="dark"] .gs-logo-img--dark {
    display: block;
}

.gs-header-search {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 640px;
    margin: 0 auto;
}

/* RTL Search Box */
[dir="rtl"] .gs-header-search {
    margin: 0 auto;
}

/* Compact search variant (reduced height) */
.gs-search-group--compact .gs-search-input {
    padding: 0.4rem 0.75rem;
    font-size: 15.6px; /* 20% bigger (13px * 1.2 = 15.6px) */
    line-height: 1.2;
}

.gs-search-group--compact .gs-search-btn {
    padding: 0.4rem 0.9rem;
    font-size: 15.6px; /* 20% bigger (13px * 1.2 = 15.6px) */
    line-height: 1.2;
}

.gs-quick-links {
    margin-top: 0.5rem;
}

/* Header Actions - Responsive Layout */
.gs-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
    overflow: visible !important; /* Allow dropdowns to overflow */
}

/* RTL Header Actions Fix */
[dir="rtl"] .gs-header-actions {
    margin-left: 0;
    margin-right: auto;
    overflow: visible !important; /* Allow dropdowns to overflow in RTL */
}

/* Desktop Actions - Visible on desktop only */
.gs-desktop-actions {
    display: flex;
}

/* Mobile Actions - Hidden on desktop */
.gs-mobile-actions {
    display: none;
}

/* Show mobile actions, hide desktop actions on tablet and below */
@media (max-width: 991.98px) {
    .gs-desktop-actions {
        display: none !important;
    }
    
    .gs-mobile-actions {
        display: flex !important;
    }
}

/* ========== HAMBURGER MENU BUTTON ========== */
.gs-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.44rem 0.66rem; /* 12% smaller (0.5rem * 0.88 = 0.44rem, 0.75rem * 0.88 = 0.66rem) */
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.gs-menu-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--gs-primary);
}

.gs-menu-toggle:focus {
    outline: none;
    box-shadow: 0 0 0 0.25rem rgba(228, 0, 43, 0.25);
    border-color: var(--gs-primary);
}

.gs-menu-toggle i {
    font-size: 15.84px; /* 12% smaller (18px * 0.88 = 15.84px) */
    display: block;
}

/* ========== MOBILE SLIDE-OUT MENU ========== */
.gs-mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
}

.gs-mobile-menu.active {
    display: block;
}

.gs-mobile-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gs-mobile-menu.active .gs-mobile-menu-overlay {
    opacity: 1;
}

.gs-mobile-menu-content {
    position: absolute;
    top: 0;
    left: -320px;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    background: var(--bg-card);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    transition: left 0.3s ease;
    overflow-y: auto;
    z-index: 10000;
}

[dir="rtl"] .gs-mobile-menu-content {
    left: auto;
    right: -320px;
    transition: right 0.3s ease;
}

.gs-mobile-menu.active .gs-mobile-menu-content {
    left: 0;
}

[dir="rtl"] .gs-mobile-menu.active .gs-mobile-menu-content {
    left: auto;
    right: 0;
}

.gs-mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-hover);
}

.gs-mobile-menu-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.gs-mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.gs-mobile-menu-close:hover {
    color: var(--gs-primary);
}

.gs-mobile-menu-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gs-mobile-menu-nav li {
    border-bottom: 1px solid var(--border-color);
}

.gs-mobile-menu-nav li:last-child {
    border-bottom: none;
}

.gs-mobile-menu-nav a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.gs-mobile-menu-nav a:hover {
    background: var(--bg-hover);
    color: var(--gs-primary);
}

.gs-mobile-menu-nav a i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.gs-mobile-menu-nav a:hover i {
    color: var(--gs-primary);
}

.gs-mobile-menu-nav a span {
    font-size: 15px;
    font-weight: 500;
}

/* Highlight RFQ link in mobile menu */
.menu-highlight {
    background: rgba(228, 0, 43, 0.05);
}

.gs-mobile-rfq-link {
    background: rgba(228, 0, 43, 0.05);
}

.gs-mobile-rfq-link i {
    color: var(--gs-primary) !important;
}

.gs-mobile-rfq-link:hover {
    background: rgba(228, 0, 43, 0.1) !important;
}

/* Menu divider */
.menu-divider {
    padding: 0;
    margin: 0.5rem 0;
    border-bottom: none;
}

.menu-divider hr {
    margin: 0;
    border-color: var(--border-color);
}

/* Menu section header */
.menu-section-header {
    padding: 0.75rem 1.25rem;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border-color);
}

.menu-section-header span {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* RTL Menu Section Header */
[dir="rtl"] .menu-section-header {
    text-align: right;
}

/* Menu utility items (Language & Theme) */
.menu-utility-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
}

.menu-utility-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.menu-utility-item > span {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

/* RTL Menu Utility Item */
[dir="rtl"] .menu-utility-item {
    direction: rtl;
}

[dir="rtl"] .menu-utility-item > span {
    text-align: right;
}

.menu-utility-control {
    margin-left: auto;
}

/* RTL Menu Utility Control */
[dir="rtl"] .menu-utility-control {
    margin-left: 0;
    margin-right: auto;
}

.menu-utility-control .dropdown-toggle,
.menu-utility-control .btn {
    padding: 0.375rem 0.75rem;
    font-size: 13px;
}

/* RTL Alignment for menu dropdown items */
[dir="rtl"] .menu-utility-control .dropdown-menu {
    text-align: right !important;
    right: 0 !important;
    left: auto !important;
}

[dir="rtl"] .menu-utility-control .dropdown-item {
    text-align: right !important;
}

/* Theme toggle in menu */
.gs-theme-toggle-mobile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle-text {
    display: inline-block;
}

/* Menu logout form */
.menu-logout-form {
    display: block;
    width: 100%;
    margin: 0;
}

.menu-logout-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    font-family: inherit;
}

[dir="rtl"] .menu-logout-btn {
    text-align: right;
}

.menu-logout-btn:hover {
    background: var(--bg-hover);
    color: var(--gs-primary);
}

.menu-logout-btn i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--text-secondary);
}

.menu-logout-btn:hover i {
    color: var(--gs-primary);
}

.menu-logout-btn span {
    font-weight: 500;
}

/* ========== EXISTING CODE CONTINUES ========== */

.gs-contact {
    display: flex;
    align-items: center;
}

    .gs-contact .small {
        line-height: 1.1;
    }

/* RTL Contact Info */
[dir="rtl"] .gs-contact {
    flex-direction: row-reverse;
}

    [dir="rtl"] .gs-contact i {
        margin-right: 0;
        margin-left: 0.5rem;
    }

/* Utility Actions (Language + Theme) */
.gs-utility-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative; /* Positioning context for dropdowns */
    z-index: 1000; /* Above other header content */
}

/* Post RFQ Button */
.gs-rfq-btn {
    white-space: nowrap;
}

/* RTL Button Icons */
[dir="rtl"] .gs-rfq-btn i {
    margin-right: 0;
    margin-left: 0.25rem;
}

/* Account Dropdown */
.gs-account {
    display: flex;
    align-items: center;
 position: relative; /* Positioning context for dropdowns */
    z-index: 1000; /* Above other header content */
}

/* Navigation */
.gs-nav-bar {
    background: #eceff5;
    border-bottom: 1px solid var(--border-color);
}

[data-bs-theme="dark"] .gs-nav-bar {
    background: #2d2f36;
}

.gs-nav-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 0;
}

.gs-categories-btn {
    display: inline-flex;
    align-items: center;
}

.gs-nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

    .gs-nav-links a {
        color: var(--text-primary);
        text-decoration: none;
        padding: 0.25rem 0.5rem;
        border-radius: 4px;
    }

        .gs-nav-links a:hover {
            background: var(--bg-hover);
        }

/* Hero combo */
.gs-hero-combo {
    background: var(--bg-body);
    padding: 1rem 0;
}

.gs-vert-cats {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.gs-vert-cats-header {
    background: #e53b45;
    color: #fff;
    font-weight: 700;
    padding: 0.5rem 0.75rem;
}

.gs-vert-cats-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem;
}

    .gs-vert-cats-list li a {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem;
        border-radius: 4px;
        color: var(--text-primary);
        text-decoration: none;
    }

        .gs-vert-cats-list li a:hover {
            background: var(--bg-hover);
        }

/* Hero Slider Integration */
.gs-hero-slider {
    aspect-ratio: 16 / 9;
    max-height: 400px;
}

/* Legacy support - can be removed */
.gs-hero-banner-simple img {
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.gs-rfq-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
}

.gs-rfq-header {
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Services ribbon */
.gs-services-ribbon {
    background: #f6f7fb;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    margin-top: 0.25rem;
}

[data-bs-theme="dark"] .gs-services-ribbon {
    background: #1f2126;
}

.gs-service-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 0.5rem 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 13px;
}

/* Breadcrumb bar */
.gs-breadcrumb-bar {
    background: #eef1f6;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

[data-bs-theme="dark"] .gs-breadcrumb-bar {
    background: #2a2d34;
}

/* Home page blocks after services ribbon */
.hp-nav-ribbon {
    background: var(--hp-ribbon);
    color: #fff;
    padding: 0.75rem 0;
    margin: 0.25rem 0
}

[data-bs-theme="dark"] .hp-nav-ribbon {
    background: #31384f
}

.hp-nav-item {
    background: transparent;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 6px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600
}

    .hp-nav-item i {
        font-size: 18px
    }

/* Latest Buy Offers & Latest Products - Table-like structure matching H1.jpg */
.hp-two-lists {
    margin-top: 1.5rem
}

.hp-latest-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

[data-bs-theme="dark"] .hp-latest-box {
    background: var(--bg-card);
    border-color: var(--border-color);
}

.hp-latest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e5e7eb;
    background: #fafafa;
}

[data-bs-theme="dark"] .hp-latest-header {
    border-bottom-color: var(--border-color);
    background: var(--bg-hover);
}

.hp-latest-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

[data-bs-theme="dark"] .hp-latest-header h3 {
    color: var(--text-primary);
}

.hp-view-more {
    font-size: 13px;
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

    .hp-view-more:hover {
        color: var(--hp-accent);
        text-decoration: underline;
    }

.hp-latest-box .hp-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .hp-latest-box .hp-list li {
        border-bottom: 1px solid #f3f4f6;
    }

[data-bs-theme="dark"] .hp-latest-box .hp-list li {
    border-bottom-color: var(--border-color);
}

.hp-latest-box .hp-list li:last-child {
    border-bottom: none;
}

/* Table-like row structure with fixed column widths */
.hp-list-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 1rem;
    transition: background-color 0.15s ease;
}

    .hp-list-item:hover {
        background-color: #f9fafb;
    }

[data-bs-theme="dark"] .hp-list-item:hover {
    background-color: var(--bg-hover);
}

/* Column 1: Flag/Icon + Country (Fixed width for Buy Offers) */
.hp-list-item .hp-flag {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    font-size: 14px;
    flex-shrink: 0;
}

[data-bs-theme="dark"] .hp-list-item .hp-flag {
    background: var(--gs-gray-700);
}

/* Column 1: Dot (for Latest Products) */
.hp-product-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc2626;
    display: inline-block;
    flex-shrink: 0;
}

/* Column 2: Content (Country + Product or just Product) - Flexible width */
.hp-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.hp-item-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hp-item-icon {
    font-size: 4px;
    color: #9ca3af;
}

.hp-country {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    line-height: 1.2;
}

.hp-product-link {
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

    .hp-product-link:hover {
        color: var(--hp-accent);
        text-decoration: underline;
    }

[data-bs-theme="dark"] .hp-product-link {
    color: var(--text-primary);
}

/* Column 3: Time Badge (Fixed width) */
.hp-time-badge {
    font-size: 11px;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
    min-width: 65px;
    text-align: center;
}

[data-bs-theme="dark"] .hp-time-badge {
    background: var(--gs-gray-800);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.hp-verified-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 0.75rem
}

.hp-verified-card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden
}

.hp-verified-thumb {
    aspect-ratio: 4/3;
    background: var(--gs-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 24px
}

[data-bs-theme="dark"] .hp-verified-thumb {
    background: var(--gs-gray-800)
}

.hp-verified-caption {
    padding: 0.5rem;
    font-size: 13px
}

/* Browse Categories title and circles */
.hp-section-title {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    margin-bottom: 0.5rem
}

    .hp-section-title::before, .hp-section-title::after {
        content: "";
        position: absolute;
        top: 50%;
        width: 48px;
        height: 2px;
        background: var(--hp-accent)
    }

    .hp-section-title::before {
        right: 100%;
        margin-right: 0.5rem
    }

    .hp-section-title::after {
        left: 100%;
        margin-left: 0.5rem
    }

.hp-cat-circles {
    display: grid;
    grid-template-columns: repeat(8,1fr);
    gap: 0.75rem;
    justify-items: center;
    margin-bottom: 1rem
}

.hp-cat-circle {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem
}

    .hp-cat-circle i {
        color: #889;
    }

.hp-cat-title {
    font-size: 12px;
    text-align: center
}

.hp-cat-details .hp-links {
    list-style: none;
    margin: 0;
    padding: 0
}

    .hp-cat-details .hp-links li {
        margin: 0.25rem 0
    }

    .hp-cat-details .hp-links a {
        text-decoration: none;
        color: var(--text-primary)
    }

/* RFQ split */
.hp-benefit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem
}

    .hp-benefit i {
        color: var(--hp-accent)
    }

/* Flags / misc */
.hp-flag-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 0.5rem
}

/* Premium suppliers / stories */
.hp-logo-grid {
    display: grid;
    grid-template-columns: repeat(6,1fr);
    gap: 0.5rem
}

.hp-logo-cell {
    aspect-ratio: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px
}

.hp-testimonial {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem
}

.hp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ccc
}

/* Escrow banner */
.hp-escrow-banner {
    height: 84px;
    background: linear-gradient(90deg,#e5f6ff,#e7ffe5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 1rem 0
}

/* Footer override (light mode) to match H1.jpg dark footer */
.gs-footer {
    background: var(--hp-footer);
    color: var(--hp-footer-text);
    border-top: none;
    margin-top: 2rem
}

.gs-footer-column h4 {
    color: #fff
}

.gs-footer-links a {
    color: var(--hp-footer-text)
}

    .gs-footer-links a:hover {
        color: #fff
    }

.gs-footer-bottom {
    border-top: 1px solid rgba(255,255,255,.15)
}

/* ========== RESPONSIVE BREAKPOINTS ========== */

/* Large tablets and below (991.98px) */
@media(max-width:991.98px) {
    /* RTL Container fixes */
    [dir="rtl"] body,
    [dir="rtl"] html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    [dir="rtl"] .gs-container,
    [dir="rtl"] .container,
    [dir="rtl"] .container-fluid {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
        max-width: 100% !important;
    }

    /* Header adjustments */
    .gs-logo-img {
        height: 50px;
    }

    .gs-header-search {
        max-width: 400px;
    }

    .gs-header-actions {
        gap: 0.25rem;
    }

        .gs-header-actions .btn {
            padding: 0.375rem 0.75rem;
            font-size: 13px;
        }

    /* Navigation */
    .gs-nav-links {
        gap: 0.5rem;
        font-size: 13px;
    }

    /* Hero slider */
    .gs-hero-slider {
        max-height: 350px;
    }

    /* Grids */
    .hp-verified-grid {
        grid-template-columns: repeat(3,1fr)
    }

    .hp-cat-circles {
        grid-template-columns: repeat(4,1fr)
    }

    .hp-logo-grid {
        grid-template-columns: repeat(4,1fr)
    }
}

/* Tablets and below (767.98px) */
@media(max-width:767.98px) {
    /* Top strip - hide on mobile */
    .gs-top-strip {
      display: none;
    }

    /* Header - Logo 25% bigger (50px * 1.25 = 62.5px) */
    .gs-logo-img {
        height: 62px; /* 25% bigger than 50px */
 }

  .gs-header-row {
        flex-wrap: wrap; /* Enable wrapping on mobile */
      gap: 0.5rem;
        padding: 0.5rem 0;
position: relative; /* Establish stacking context for children */
    }

    /* CRITICAL: Keep RTL direction intact - don't unset it */
    [dir="rtl"] .gs-header-row {
        overflow: visible !important;
        width: 100%;
        flex-basis: 100%;
    }

    /* Logo stays first and aligns to start */
    .gs-logo {
        order: 1;
   flex: 0 0 auto;
  margin-right: auto;
    }

    /* RTL: Logo aligns to start (right side) */
    [dir="rtl"] .gs-logo {
   margin-right: 0;
   margin-left: auto;
    }

    /* Header actions move to end (right side), before search */
    .gs-header-actions {
order: 2;
  margin-left: 0;
        margin-right: 0;
        flex-wrap: nowrap;
        position: relative;
     z-index: 2; /* Above search box */
}

    /* RTL: Header actions stay on end (left side) */
    [dir="rtl"] .gs-header-actions {
  margin-left: 0;
  margin-right: 0;
    }

    /* RTL body and container fixes */
    [dir="rtl"] body,
    [dir="rtl"] html {
     overflow-x: hidden !important;
     width: 100% !important;
     max-width: 100vw !important;
    }

  [dir="rtl"] .gs-container,
    [dir="rtl"] .container,
    [dir="rtl"] .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        margin-left: auto !important;
  margin-right: auto !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    [dir="rtl"] .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
     width: 100% !important;
   max-width: 100% !important;
}

    [dir="rtl"] [class*="col-"] {
   padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

 /* Hide account dropdown text on tablets and mobile */
    .gs-account .dropdown-toggle span {
     display: none !important;
    }

    /* Keep only the account icon visible */
    .gs-account .dropdown-toggle {
   padding: 0.375rem 0.5rem;
    }

    /* Menu toggle - 12% smaller in tablet mode */
    .gs-menu-toggle {
        padding: 0.44rem 0.66rem; /* 12% smaller (0.5rem * 0.88 = 0.44rem) */
    }

    .gs-menu-toggle i {
        font-size: 17.6px; /* 12% smaller (20px * 0.88 = 17.6px) */
    }

    /* Search box goes to new line, full width */
    .gs-header-search {
        order: 3;
  flex: 1 1 100%;
  max-width: 100%;
        margin: 0 !important;
        position: relative;
        z-index: 1; /* Below header actions */
    }

    /* RTL Search fix */
    [dir="rtl"] .gs-header-search {
     max-width: 100% !important;
    width: 100% !important;
    }
}

/* Small mobile (575.98px and below) */
@media(max-width:575.98px) {
    /* Container padding */
    .gs-container {
      padding: 0 0.75rem;
    }

    /* RTL Container fixes for small mobile */
    [dir="rtl"] .gs-container,
    [dir="rtl"] .container,
    [dir="rtl"] .container-fluid {
        padding-left: 0.75rem !important;
      padding-right: 0.75rem !important;
  max-width: 100% !important;
    }

    /* Ensure no element creates horizontal scroll */
    [dir="rtl"] * {
   max-width: 100%;
    }

    /* CRITICAL: Keep RTL direction intact in mobile mode */
    [dir="rtl"] .gs-header-row {
     width: 100% !important;
  max-width: 100% !important;
        min-width: 0 !important; /* Prevent flex expansion */
        overflow: visible !important; /* Allow dropdowns to overflow */
flex-shrink: 1 !important;
   flex-grow: 0 !important;
        flex-basis: 100% !important;
    }

    /* Keep nav-row separate */
    [dir="rtl"] .gs-nav-row {
        width: 100% !important;
        max-width: 100% !important;
    min-width: 0 !important;
   overflow: visible !important;
  }
    
    /* Logo - 25% bigger (45px * 1.25 = 56px) */
    .gs-logo-img {
 height: 56px; /* 25% bigger than 45px */
    }

    .gs-logo {
      font-size: 16px;
    }

    /* Header actions - compact layout */
    .gs-header-actions {
        gap: 0.35rem;
    }

    /* Menu toggle - 12% smaller for easier touch */
    .gs-menu-toggle {
        padding: 0.396rem 0.616rem; /* 12% smaller (0.45rem * 0.88 = 0.396rem, 0.7rem * 0.88 = 0.616rem) */
    }

    .gs-menu-toggle i {
        font-size: 19.36px; /* 12% smaller (22px * 0.88 = 19.36px) */
    }

    /* Search - 20% bigger font */
    .gs-search-group--compact .gs-search-input {
        padding: 0.35rem 0.6rem;
        font-size: 14.4px; /* 20% bigger (12px * 1.2 = 14.4px) */
    }

    .gs-search-group--compact .gs-search-btn {
        padding: 0.35rem 0.6rem;
      font-size: 14.4px; /* 20% bigger (12px * 1.2 = 14.4px) */
    }

    .gs-search-btn span {
        display: none;
    }

    /* RTL: Keep search icon centered */
    [dir="rtl"] .gs-search-btn i {
        margin-right: 0;
    margin-left: 0;
    }

    /* Navigation */
    .gs-nav-links {
        font-size: 11px;
    }

    .gs-nav-links a {
 padding: 0.2rem 0.35rem;
    }

    /* Hero */
    .gs-hero-slider {
        aspect-ratio: 4 / 3;
max-height: 250px;
    }

    /* Services ribbon */
    .gs-service-pill {
        font-size: 11px;
        padding: 0.35rem 0.5rem;
    }

.gs-service-pill i {
        font-size: 14px;
    }

    /* Latest sections */
    .hp-verified-grid {
        grid-template-columns: repeat(2,1fr);
    }

    .hp-cat-circles {
      grid-template-columns: repeat(3,1fr);
    }

    .hp-logo-grid {
        grid-template-columns: repeat(3,1fr);
    }

    .hp-list-item {
        padding: 0.6rem;
        gap: 0.5rem;
 }

    .hp-list-item .hp-flag {
        width: 20px;
    height: 20px;
   font-size: 12px;
    }

    .hp-product-dot {
        width: 6px;
        height: 6px;
    }

    .hp-time-badge {
        min-width: 55px;
        font-size: 10px;
    }

    /* Category circles */
    .hp-cat-circle {
  width: 60px;
        height: 60px;
      font-size: 11px;
    }

    .hp-cat-title {
    font-size: 10px;
 }
}

/* Extra small mobile (475px and below) */
@media(max-width:475px) {
    .gs-header-row {
        padding: 0.4rem 0;
 }

    /* Logo - keep at 56px (don't reduce further) */
    .gs-logo-img {
        height: 56px;
    }

    .hp-nav-ribbon {
        padding: 0.5rem 0;
      margin: 0.2rem 0;
    }

    .hp-nav-item {
        padding: 0.4rem;
        font-size: 11px;
  }

    .hp-nav-item i {
  font-size: 14px;
    }

    .hp-latest-header {
        padding: 0.6rem 0.75rem;
    }

    .hp-latest-header h3 {
font-size: 14px;
    }
}

/* ========== DROPDOWN POSITIONING FIXES ========== */

/* Dropdown Container Positioning - Desktop */
.gs-utility-actions .dropdown,
.gs-account .dropdown,
.gs-header-actions .dropdown {
    position: relative;
    z-index: 1000;
}

/* Dropdown Menu z-index */
.gs-header-actions .dropdown-menu,
.gs-utility-actions .dropdown-menu,
.gs-account .dropdown-menu {
    z-index: 1050; /* Bootstrap dropdown z-index */
}

/* Tablet RTL Dropdown Fixes (767.98px) */
@media(max-width:767.98px) {
    /* CRITICAL: Override container overflow for header to allow dropdowns */
    [dir="rtl"] .gs-main-header .gs-container {
        overflow: visible !important;
  }
    
    /* Allow dropdowns to overflow in RTL tablet mode */
    [dir="rtl"] .gs-main-header,
    [dir="rtl"] .gs-header-row,
 [dir="rtl"] .gs-header-actions {
        overflow: visible !important;
    }
}

/* Small Mobile RTL Dropdown Fixes (575.98px) */
@media(max-width:575.98px) {
    /* CRITICAL: Override container overflow for header to allow dropdowns */
    [dir="rtl"] .gs-main-header .gs-container {
    overflow: visible !important;
    }
    
    /* Allow dropdowns to overflow in RTL mobile mode - full visibility */
  [dir="rtl"] .gs-header-row {
  width: 100% !important;
     max-width: 100% !important;
    overflow: visible !important; /* Allow dropdowns to overflow both axes */
}
    
 [dir="rtl"] .gs-main-header,
    [dir="rtl"] .gs-header-actions {
     overflow: visible !important;
    }
    
    /* Ensure dropdown menus align correctly in RTL */
    [dir="rtl"] .gs-header-actions .dropdown-menu,
    [dir="rtl"] .gs-utility-actions .dropdown-menu,
    [dir="rtl"] .gs-account .dropdown-menu {
    right: 0 !important;
  left: auto !important;
    }
}
