/* =========================================================================
   EBCM - Construction Materials Supplier stylesheet
   ========================================================================= */

/* --- Variables --- */
:root {
    /* Colors */
    --primary-color: #FF8A00; /* Construction Orange */
    --primary-dark: #E67A00;
    --primary-light: #FFB347;
    --secondary-color: #212529; /* Dark Gray / Almost Black */
    --text-color: #333333;
    --text-light: #6C757D;
    --bg-light: #F8F9FA;
    --white: #FFFFFF;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Transitions */
    --transition: all 0.3s ease;
    
    /* Shadows */
    --shadow-sm: 0 2px 5px rgba(0,0,0,0.05);
    --shadow-md: 0 5px 15px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
}

/* RTL Support for Arabic */
[dir="rtl"] {
    text-align: right;
}
[dir="rtl"] .fas.fa-arrow-right {
    transform: rotate(180deg);
}
[dir="rtl"] .step-connector {
    right: 50px;
    left: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-weight: 700;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Accessibility Focus States */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

ul {
    list-style: none;
}

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

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.section-title {
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

[dir="rtl"] .section-title h2::after {
    right: 50%;
    transform: translateX(50%);
}

.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.text-primary { color: var(--primary-color); }
.bg-light { background-color: var(--bg-light); }
.bg-dark { background-color: var(--secondary-color); color: var(--white); }

/* --- Badge --- */
.badge {
    display: inline-block;
    padding: 5px 15px;
    background-color: rgba(255, 138, 0, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.badge-light {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-align: center;
}

.btn i {
    margin: 0 5px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(255, 138, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 138, 0, 0.4);
}

.btn-primary-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-primary-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background-color: #25D366; /* WhatsApp Green */
    color: var(--white);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.btn-secondary:hover {
    background-color: #128C7E;
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

.btn-block {
    display: block;
    width: 100%;
}

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    padding: 20px 0;
    z-index: 1000;
    transition: var(--transition);
}

.header.scrolled {
    background-color: var(--white);
    padding: 15px 0;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: 1px;
    transition: var(--transition);
}

.header.scrolled .logo-text {
    color: var(--secondary-color);
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: var(--white);
    font-weight: 500;
    position: relative;
}

.header.scrolled .nav-link:not(.btn-primary-outline) {
    color: var(--secondary-color);
}

.nav-link.btn-primary-outline {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    color: var(--primary-color) !important;
}

.header.scrolled .nav-link.btn-primary-outline {
    padding: 8px 20px;
    color: var(--primary-color) !important;
}

.nav-link.btn-primary-outline:hover {
    color: var(--white) !important;
}

.nav-link:not(.btn-primary-outline)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover:not(.btn-primary-outline)::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 500;
    transition: var(--transition);
}

.header.scrolled .lang-btn {
    background: var(--bg-light);
    border-color: #ddd;
    color: var(--text-color);
}

.lang-btn img {
    border-radius: 2px;
}

.lang-btn i {
    font-size: 0.8rem;
    transition: var(--transition);
}

.lang-selector.active .lang-btn i {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    width: 120px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 100;
}

[dir="rtl"] .lang-dropdown {
    right: auto;
    left: 0;
}

.lang-selector.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
}

.lang-option:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--white);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.header.scrolled .mobile-toggle {
    color: var(--secondary-color);
}

.mobile-toggle:hover {
    background: rgba(255,138,0,0.1);
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #1a1a1a 100%);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at right center, rgba(255, 138, 0, 0.15) 0%, transparent 50%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    color: var(--white);
}

.hero .subtitle {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 4rem;
    color: var(--white);
    margin-bottom: 20px;
}

.text-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.hero p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

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

.about-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.stat-box {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
}

[dir="rtl"] .stat-box {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

.stat-box:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.stat-box i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.stat-box h4 {
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.stat-box p {
    margin-bottom: 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

/* --- Products Section --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    background: var(--white);
    padding: 40px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
    border-bottom: 4px solid transparent;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-10px);
    border-bottom-color: var(--primary-color);
}

.product-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 138, 0, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px;
    transition: var(--transition);
}

.product-card:hover .product-icon {
    background: var(--primary-color);
    color: var(--white);
}

.product-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.product-card p {
    color: var(--text-light);
    margin-bottom: 0;
    font-size: 0.95rem;
}

/* --- How It Works Section --- */
.steps-container {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--white);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-heading);
    margin: 0 auto 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.step:hover .step-number {
    background: var(--primary-color);
    color: var(--white);
}

.step h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.step p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.step-connector {
    position: absolute;
    top: 30px;
    left: calc(16.66% + 30px);
    width: calc(33.33% - 60px);
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.step-connector:nth-of-type(2) {
    left: calc(50% + 30px);
}

/* RTL Adjustments for How it works connections handled via js/css selector above */

/* --- Service Area Section --- */
.service-area {
    background-image: url('data:image/svg+xml;utf8,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><circle cx="2" cy="2" r="2" fill="%23ffffff" fill-opacity="0.05"/></svg>');
}

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

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

.area-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.area-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.area-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.area-list i {
    color: var(--primary-color);
}

.area-map {
    width: 100%;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.map-placeholder i {
    font-size: 4rem;
    margin-bottom: 15px;
}

.map-placeholder h3 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
}

/* --- Team Section --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 20px;
}

.team-member {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: var(--transition);
}

.team-member:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.member-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary-color);
    padding: 3px;
    background: var(--white);
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background-color: var(--bg-light); /* Fallback empty bg */
}

.team-member h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.team-member .role {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* --- Workspace Gallery Section --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    display: block;
    background-color: var(--bg-light); /* Fallback */
}

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

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(33, 37, 41, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-overlay i {
    color: var(--white);
    font-size: 2rem;
    transform: scale(0.5);
    transition: transform 0.3s ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
    transform: scale(1.1);
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
    opacity: 1;
}

.gallery-item:hover .gallery-overlay i,
.gallery-item:focus-visible .gallery-overlay i {
    transform: scale(1);
}

/* --- Contact & Quote Section --- */
.flex-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.quote-form-container {
    flex: 2;
    min-width: 300px;
}

.contact-info-container {
    flex: 1;
    min-width: 300px;
    padding: 40px;
    border-radius: var(--radius-lg);
    border: 1px solid #e9ecef;
}

.contact-info-container h3 {
    margin-bottom: 10px;
}

.contact-info-container > p {
    color: var(--text-light);
    margin-bottom: 30px;
}

.quote-form .form-row {
    display: flex;
    gap: 20px;
}

.quote-form .form-group {
    margin-bottom: 20px;
    flex: 1;
}

.quote-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--secondary-color);
}

.quote-form input,
.quote-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.quote-form input:focus,
.quote-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.1);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

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

.method-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 138, 0, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.method-details h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.method-details a {
    color: var(--text-light);
    font-size: 0.95rem;
}

.method-details a:hover {
    color: var(--primary-color);
}

/* --- Footer --- */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo-text {
    display: inline-block;
    margin-bottom: 15px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    max-width: 300px;
}

.footer-links h4,
.footer-social h4 {
    color: var(--white);
    margin-bottom: 20px;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

[dir="rtl"] .footer-links ul li a:hover {
    padding-left: 0;
    padding-right: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
}

.social-icons a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* --- Animations --- */
.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.fade-in.appear {
    opacity: 1;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.appear {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Media Queries --- */
@media (max-width: 992px) {
    .about-grid, .area-content {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
    
    .flex-contact {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        padding: 20px;
        box-shadow: var(--shadow-md);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: var(--transition);
    }
    
    .nav-menu.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .nav-link {
        color: var(--secondary-color);
        display: block;
        width: 100%;
        padding: 10px 0;
    }
    
    .nav-link.btn-primary-outline {
        text-align: center;
        margin-top: 10px;
    }
    
    .header.scrolled {
        background-color: var(--white);
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .steps-container {
        flex-direction: column;
        gap: 40px;
    }
    
    .step-connector {
        display: none;
    }
    
    .quote-form .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .area-list {
        grid-template-columns: 1fr;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}
