/* 
   Al-Huda Salt Company - Main Stylesheet
   Focus: Clean, industrial, premium B2B aesthetic.
*/

:root {
    /* Color Palette */
    --clr-white: #FFFFFF;
    --clr-navy: #0A192F;
    /* Deep ocean/export navy */
    --clr-navy-light: #112240;
    /* Slightly lighter navy for cards */
    --clr-grey-light: #F8FAFC;
    /* Off-white for section backgrounds */
    --clr-grey: #94A3B8;
    /* Subtle text color */
    --clr-text-main: #1E293B;
    /* Slate dark for main readable text */
    --clr-gold: #C5A059;
    /* Subtle premium accent */

    /* Typography */
    --font-en: 'Inter', sans-serif;
    --font-ar: 'Cairo', sans-serif;

    /* Variables that will change based on language direction */
    --font-primary: var(--font-en);
    /* Shadows & Transitions */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* RTL Specific Overrides */
html[dir="rtl"] {
    --font-primary: var(--font-ar);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--clr-white);
    color: var(--clr-text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   Typography & Utilities
   ========================================= */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--clr-navy);
    line-height: 1.2;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.section-padding {
    padding: 100px 5%;
}

/* =========================================
   Buttons
   ========================================= */
.btn-primary {
    display: inline-block;
    padding: 16px 32px;
    background-color: var(--clr-navy);
    color: var(--clr-white);
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--clr-gold);
    transition: var(--transition);
    z-index: -1;
}

.btn-primary:hover::before {
    width: 100%;
}

.btn-primary-small {
    padding: 10px 24px;
    background-color: var(--clr-navy);
    color: var(--clr-white);
    border-radius: 4px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary-small:hover {
    background-color: var(--clr-gold);
}

/* =========================================
   Navigation
   ========================================= */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-img {
    height: 120px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    color: var(--clr-navy);
    transition: var(--transition);
    position: relative;
}

.nav-links a:not(.btn-primary-small)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--clr-gold);
    transition: var(--transition);
}

.nav-links a:not(.btn-primary-small):not(.nav-contact-link):hover::after {
    width: 100%;
}

.nav-contact-link {
    color: var(--clr-gold) !important;
    font-weight: 700 !important;
    padding: 8px 16px;
    border: 2px solid var(--clr-gold);
    border-radius: 4px;
    transition: var(--transition);
}

.nav-contact-link:hover {
    background-color: var(--clr-gold);
    color: var(--clr-white) !important;
}

.lang-selector {
    display: flex;
    gap: 8px;
    align-items: center;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--clr-navy);
    color: var(--clr-navy);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    font-family: inherit;
    transition: var(--transition);
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--clr-navy);
    color: var(--clr-white);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--clr-navy);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    padding: 20px 5%;
    background: var(--clr-white);
    border-top: 1px solid var(--clr-grey-light);
}

.mobile-menu.active {
    display: flex;
}

.mobile-menu a {
    padding: 15px 0;
    border-bottom: 1px solid var(--clr-grey-light);
    font-weight: 600;
    color: var(--clr-navy);
}

.mobile-lang-selector {
    margin-top: 15px;
    align-self: flex-start;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    height: 100vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 5%;
    background-image: url('../assets/images/hero_bg_salt.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}


/* Added dynamically by JS or inline HTML to hero section */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dark gradient overlay to ensure text readability against light salt */
    background: linear-gradient(to bottom, rgba(10, 25, 47, 0.7), rgba(10, 25, 47, 0.4));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    color: var(--clr-white);
    transform: translateY(20px);
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.3s;
}

.hero h1 {
    color: var(--clr-white);
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    margin-bottom: 40px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--clr-white);
    font-size: 2rem;
    animation: bounce 2s infinite;
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-20px) translateX(-50%);
    }

    60% {
        transform: translateY(-10px) translateX(-50%);
    }
}

/* =========================================
   Responsive Basics
   ========================================= */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}

/* =========================================
   About Us Section
   ========================================= */
.section-title {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--clr-gold);
}

.text-center {
    text-align: center;
}

.text-center::after {
    left: 50%;
    transform: translateX(-50%);
}

.bg-light {
    background-color: var(--clr-grey-light);
}

.about-container {
    max-width: 1200px;
    margin: 0 auto;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: var(--clr-text-main);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-card {
    background: var(--clr-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-top: 4px solid var(--clr-navy);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-top-color: var(--clr-gold);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--clr-navy);
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--clr-grey);
    font-size: 0.9rem;
    font-weight: 600;
}

/* =========================================
   Our Process Section
   ========================================= */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 40px;
}

.process-step {
    text-align: center;
    padding: 30px 20px;
    background: var(--clr-white);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: var(--transition);
}

.process-step:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.process-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background-color: var(--clr-grey-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--clr-navy);
    transition: var(--transition);
}

.process-step:hover .process-icon {
    background-color: var(--clr-navy);
    color: var(--clr-white);
}

.process-step h4 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.process-step p {
    color: var(--clr-grey);
    font-size: 0.95rem;
}

/* =========================================
   Products Section
   ========================================= */
.products-container {
    max-width: 1400px;
    margin: 0 auto;
}

.products-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding-top: 40px;
}

.product-card {
    width: calc(25% - 30px);
    min-width: 250px;
    background: var(--clr-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-md);
}

.product-img {
    height: 250px;
    width: 100%;
    overflow: hidden;
    position: relative;
    background-color: var(--clr-grey-light);
    /* fallback */
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-content {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-content h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--clr-navy);
}

.product-content p {
    color: var(--clr-text-main);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* =========================================
   Quality Assurance Section
   ========================================= */
.bg-navy {
    background-color: var(--clr-navy);
}

.text-white {
    color: var(--clr-white);
}

.title-white {
    color: var(--clr-white);
}

.text-gold {
    color: var(--clr-gold) !important;
}

.quality-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.quality-text h2 {
    color: var(--clr-white);
}

.quality-desc {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.quality-list {
    margin-bottom: 30px;
}

.quality-list li {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.quality-list i {
    font-size: 1.5rem;
}

.quality-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.certificate-mock {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 50px;
    border-radius: 12px;
    text-align: center;
    position: relative;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.certificate-mock:hover {
    transform: translateY(-10px) rotate(2deg);
}

.certificate-mock h3 {
    color: var(--clr-gold);
    margin: 20px 0;
    font-family: serif;
    /* Elegant contrast */
    letter-spacing: 2px;
}

.cert-lines {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cert-line {
    height: 3px;
    width: 80%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.cert-line.short {
    width: 50%;
}

.cert-seal {
    width: 60px;
    height: 60px;
    background: var(--clr-gold);
    border-radius: 50%;
    position: absolute;
    bottom: -30px;
    right: 40px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 3px dashed rgba(255, 255, 255, 0.5);
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .quality-container {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}

/* =========================================
   Contact Section
   ========================================= */
.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.contact-container.no-form {
    grid-template-columns: 1fr;
    max-width: 800px;
}

.center-methods {
    align-items: center;
    justify-content: center;
    margin-top: 40px;
}

.center-methods .contact-method {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 10px;
}

.center-methods .contact-method i {
    margin-bottom: 5px;
}

.contact-info {
    padding-right: 40px;
}

.contact-container.no-form .contact-info {
    padding-right: 0;
}

.contact-info p {
    font-size: 1.1rem;
    color: var(--clr-text-main);
    margin-bottom: 40px;
}

.contact-methods {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
}

.contact-method {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.contact-method i {
    font-size: 2rem;
    color: var(--clr-navy);
    background: var(--clr-grey-light);
    padding: 15px;
    border-radius: 50%;
    transition: var(--transition);
}

.contact-method:hover i {
    background: var(--clr-navy);
    color: var(--clr-white);
}

.contact-method h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--clr-navy);
}

.contact-method p {
    margin-bottom: 5px;
    /* Adds small spacing between lines */
    color: var(--clr-grey);
    font-size: 1rem;
    direction: ltr;
    /* keep phone numbers ltr */
    display: block;
    /* ensure each p breaks to a new line */
}

/* NEW: Ensures contact text aligns properly next to icon */
.contact-text-block {
    text-align: left;
    max-width: 350px;
}

/* Specific Arabic override for alignment based on direction */
html[dir="rtl"] .contact-text-block {
    text-align: right;
}

/* =========================================
   Gallery Slider Section
   ========================================= */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-tab {
    background: transparent;
    border: 2px solid var(--clr-navy);
    color: var(--clr-navy);
    padding: 12px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.gallery-tab:hover,
.gallery-tab.active {
    background: var(--clr-navy);
    color: var(--clr-white);
}

.gallery-content {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.gallery-content.active {
    display: block;
    opacity: 1;
}

.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
}

.gallery-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 20px;
    /* space for scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--clr-navy) var(--clr-grey-light);
}

.gallery-slider::-webkit-scrollbar {
    height: 8px;
}

.gallery-slider::-webkit-scrollbar-track {
    background: var(--clr-grey-light);
    border-radius: 4px;
}

.gallery-slider::-webkit-scrollbar-thumb {
    background-color: var(--clr-navy);
    border-radius: 4px;
}

.gallery-item {
    min-width: 300px;
    height: 400px;
    flex-shrink: 0;
    scroll-snap-align: center;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--clr-white);
    cursor: pointer;
    /* indicate it's clickable */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.slider-arrow {
    background: var(--clr-white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--clr-navy);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    flex-shrink: 0;
    z-index: 10;
}

.slider-arrow:hover {
    background: var(--clr-navy);
    color: var(--clr-white);
}

/* RTL specific for gallery */
html[dir="rtl"] .slider-arrow .ph-caret-left {
    transform: rotate(180deg);
}

html[dir="rtl"] .slider-arrow .ph-caret-right {
    transform: rotate(180deg);
}

/* =========================================
   Lightbox Modal
   ========================================= */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    /* Deep shadow */
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.show {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    background: var(--clr-white);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.show .lightbox-content {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    user-select: none;
}

html[dir="rtl"] .lightbox-close {
    right: auto;
    left: 40px;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--clr-gold);
    text-decoration: none;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--clr-white);
    border: none;
    font-size: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10000;
}

.lightbox-arrow:hover {
    background: var(--clr-gold);
    color: var(--clr-navy);
}

.lightbox-prev {
    left: 40px;
}

.lightbox-next {
    right: 40px;
}

/* RTL specific for lightbox arrows using logic from script */
html[dir="rtl"] .lightbox-prev {
    left: auto;
    right: 40px;
}

html[dir="rtl"] .lightbox-next {
    right: auto;
    left: 40px;
}

/* =========================================
   Footer
   ========================================= */
.footer {
    background: var(--clr-navy-light);
    color: var(--clr-white);
    padding: 60px 5% 20px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.footer-logo-img {
    height: 160px;
    width: auto;
    filter: brightness(0) invert(1);
    /* Ensure it contrasts against dark footer if it's a dark logo */
}

.footer-logo .logo-text {
    font-size: 2rem;
}

.footer-logo p {
    color: var(--clr-grey);
    margin-top: 10px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    color: var(--clr-grey);
    font-size: 0.9rem;
}

/* Additional Responsive Tweaks */
@media (max-width: 768px) {
    .contact-container {
        grid-template-columns: 1fr;
    }

    .contact-info {
        padding-right: 0;
    }
}