/* ==========================================================================
   El-Masrya Foods — Main Stylesheet
   Brand Palette derived from assets/images/elmasryafoods-logo.png
   ========================================================================== */

:root {
    --brand-green: #2E5A36;
    --brand-green-mid: #3B6E41;
    --brand-green-soft: #eef5ef;
    --brand-dark: #13262B;
    --brand-gold: #F4B925;
    --brand-gold-deep: #D89412;
    --brand-gold-soft: #fff8e6;
    --brand-cream: #FBF9F2;
    --text-main: #1d2d30;
    --text-muted: #5a6c70;
    --border-subtle: rgba(19, 38, 43, 0.1);
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-ar: 'Cairo', system-ui, -apple-system, sans-serif;
    --radius-lg: 18px;
    --shadow-soft: 0 12px 35px rgba(19, 38, 43, 0.08);
    --shadow-hover: 0 20px 45px rgba(19, 38, 43, 0.14);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-main);
    background-color: #ffffff;
    overflow-x: hidden;
}

[dir="rtl"] body {
    font-family: var(--font-ar);
}

h1, h2, h3, .section-title {
    color: var(--brand-dark);
}

.font-display {
    font-family: var(--font-display);
}

[dir="rtl"] .font-display {
    font-family: var(--font-ar);
}

/* Top Utility Bar */
.top-utility-bar {
    background: var(--brand-dark);
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.82rem;
    border-bottom: 2px solid rgba(244, 185, 37, 0.35);
}

.top-utility-bar a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s;
}

.top-utility-bar a:hover {
    color: var(--brand-gold);
}

.lang-switch-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 50px;
    background: rgba(244, 185, 37, 0.16);
    border: 1px solid rgba(244, 185, 37, 0.45);
    color: #FFE082 !important;
    font-weight: 700;
    font-size: 0.78rem;
}

.lang-switch-pill:hover {
    background: var(--brand-gold);
    color: var(--brand-dark) !important;
}

/* Main Navbar */
.main-navbar {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    transition: box-shadow 0.25s ease, padding 0.25s ease;
    padding: 0.65rem 0;
}

.main-navbar.is-scrolled {
    box-shadow: 0 10px 30px rgba(19, 38, 43, 0.1);
}

.brand-logo-img {
    height: 54px;
    width: auto;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.navbar-brand:hover .brand-logo-img {
    transform: scale(1.02);
}

.main-navbar .nav-link {
    font-weight: 600;
    font-size: 0.94rem;
    color: var(--brand-dark);
    padding: 0.55rem 1rem !important;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
    color: var(--brand-green);
    background: var(--brand-green-soft);
}

/* Buttons */
.btn-brand-gold {
    background: linear-gradient(135deg, #F4B925 0%, #E09F18 100%);
    color: var(--brand-dark);
    font-weight: 700;
    border: 0;
    border-radius: 50px;
    padding: 0.75rem 1.75rem;
    box-shadow: 0 10px 24px rgba(244, 185, 37, 0.3);
    transition: all 0.25s ease;
}

.btn-brand-gold:hover {
    background: linear-gradient(135deg, #ffca42 0%, #e7a71e 100%);
    color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(244, 185, 37, 0.42);
}

.btn-brand-green {
    background: var(--brand-green);
    color: #ffffff;
    font-weight: 700;
    border: 0;
    border-radius: 50px;
    padding: 0.75rem 1.75rem;
    transition: all 0.25s ease;
}

.btn-brand-green:hover {
    background: #23472a;
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-outline-light-gold {
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #ffffff;
    font-weight: 700;
    border-radius: 50px;
    padding: 0.72rem 1.65rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(6px);
    transition: all 0.25s ease;
}

.btn-outline-light-gold:hover {
    border-color: var(--brand-gold);
    background: rgba(244, 185, 37, 0.16);
    color: #FFE082;
}

/* Section Headers */
.section-pad {
    padding: 5rem 0;
}

.section-cream {
    background: var(--brand-cream);
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    background: var(--brand-green-soft);
    color: var(--brand-green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.55rem);
    font-weight: 800;
    line-height: 1.2;
}

/* Certification Ribbon */
.cert-ribbon {
    background: var(--brand-green);
    color: #ffffff;
    border-bottom: 4px solid var(--brand-gold);
}

.cert-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.cert-code {
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-weight: 800;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Stats Strip */
.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.65rem 1.25rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.25s ease, border-color 0.25s ease;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-gold);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--brand-gold-soft);
    color: var(--brand-gold-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.85rem;
}

.stat-number {
    font-size: 2.15rem;
    font-weight: 800;
    color: var(--brand-green);
    line-height: 1.1;
}

/* About Visual Frame */
.about-image-frame {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(19, 38, 43, 0.16);
}

.about-image-frame img {
    width: 100%;
    height: 430px;
    object-fit: cover;
}

.about-floating-badge {
    position: absolute;
    bottom: 20px;
    inset-inline-start: 20px;
    background: rgba(19, 38, 43, 0.92);
    color: #ffffff;
    padding: 1rem 1.35rem;
    border-radius: 14px;
    border-inline-start: 4px solid var(--brand-gold);
    backdrop-filter: blur(10px);
}

/* Service Cards */
.service-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    box-shadow: var(--shadow-soft);
    transition: all 0.28s ease;
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-green), var(--brand-gold));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
}

.service-card:hover::after {
    transform: scaleX(1);
}

.service-icon-box {
    width: 58px;
    height: 58px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--brand-green) 0%, var(--brand-green-mid) 100%);
    color: var(--brand-gold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    margin-bottom: 1.25rem;
}

.service-tag {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--brand-gold-deep);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Product Filter & Cards */
.product-filter-btn {
    border: 1px solid var(--border-subtle);
    background: #ffffff;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 0.88rem;
    padding: 0.55rem 1.3rem;
    border-radius: 50px;
    transition: all 0.22s ease;
}

.product-filter-btn:hover,
.product-filter-btn.active {
    background: var(--brand-green);
    border-color: var(--brand-green);
    color: #ffffff;
}

.product-card {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 100%;
    box-shadow: var(--shadow-soft);
    transition: all 0.28s ease;
    display: flex;
    flex-direction: column;
}

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

.product-img-wrap {
    position: relative;
    height: 230px;
    overflow: hidden;
    background: var(--brand-dark);
}

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

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

.product-badge {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    background: var(--brand-gold);
    color: var(--brand-dark);
    font-weight: 800;
    font-size: 0.74rem;
    padding: 4px 12px;
    border-radius: 50px;
}

.pack-chip {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--brand-green-soft);
    color: var(--brand-green);
    border: 1px solid rgba(46, 90, 54, 0.16);
}

/* Dual Location Cards (Head Office & Factory) */
.location-card {
    border-radius: 22px;
    overflow: hidden;
    height: 100%;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    background: #ffffff;
}

.location-header-office {
    background: linear-gradient(135deg, var(--brand-dark) 0%, #1e4248 100%);
    color: #ffffff;
    padding: 1.75rem 2rem;
    border-bottom: 4px solid var(--brand-gold);
}

.location-header-factory {
    background: linear-gradient(135deg, var(--brand-green) 0%, #23472a 100%);
    color: #ffffff;
    padding: 1.75rem 2rem;
    border-bottom: 4px solid var(--brand-gold);
}

.location-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 50px;
    background: rgba(244, 185, 37, 0.18);
    border: 1px solid rgba(244, 185, 37, 0.45);
    color: #FFE082;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.7rem;
}

.location-info-row {
    display: flex;
    gap: 14px;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--border-subtle);
}

.location-info-row:last-of-type {
    border-bottom: 0;
}

.location-info-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-green-soft);
    color: var(--brand-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Page Banner (Subpages) */
.inner-page-banner {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-green) 100%);
    color: #ffffff;
    padding: 4rem 0;
    border-bottom: 4px solid var(--brand-gold);
}

/* Footer */
.site-footer {
    background: var(--brand-dark);
    color: rgba(255, 255, 255, 0.78);
    border-top: 4px solid var(--brand-gold);
}

.footer-logo-wrap {
    background: #ffffff;
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: var(--brand-gold);
}

/* Back to Top */
#backToTop {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--brand-gold);
    color: var(--brand-dark);
    border: 0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#backToTop:hover {
    transform: translateY(-3px);
}

/* ==========================================================================
   Optimized Form Inputs & Controls (Frontend)
   ========================================================================== */
.form-label {
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 0.84rem;
    margin-bottom: 0.45rem;
}

.form-control,
.form-select {
    background-color: #f7faf8;
    border: 1.5px solid rgba(19, 38, 43, 0.14);
    border-radius: 12px;
    color: var(--brand-dark);
    font-size: 0.94rem;
    font-weight: 500;
    padding: 0.72rem 1rem;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control-lg,
.form-select-lg {
    padding: 0.82rem 1.05rem;
    font-size: 0.96rem;
    border-radius: 13px;
}

.form-control::placeholder {
    color: #8b9a9d;
    font-weight: 400;
}

.form-control:hover:not(:disabled),
.form-select:hover:not(:disabled) {
    border-color: rgba(46, 90, 54, 0.38);
    background-color: #fbfdfc;
}

.form-control:focus,
.form-select:focus {
    background-color: #ffffff;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 4px rgba(46, 90, 54, 0.13);
    color: var(--brand-dark);
}

.input-group .input-group-text {
    background-color: #eef5ef;
    border: 1.5px solid rgba(19, 38, 43, 0.14);
    color: var(--brand-green);
    border-radius: 12px;
    padding: 0 0.95rem;
}

/* ==========================================================================
   Tabbed Locations — Clean Split Layout (Map + Airy Info) & Optimized Tabs
   ========================================================================== */
.loc-tabs-nav {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 6px;
    background: #ffffff;
    padding: 6px;
    border-radius: 50px;
    border: 1px solid rgba(19, 38, 43, 0.1);
    box-shadow: 0 8px 24px rgba(19, 38, 43, 0.06);
}

.loc-tab-btn {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 0.72rem 1.75rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.92rem;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: all 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    white-space: nowrap;
}

.loc-tab-btn i {
    font-size: 1.05rem;
    transition: color 0.24s ease;
}

.loc-tab-btn:hover {
    color: var(--brand-green);
    background: var(--brand-green-soft);
}

.loc-tab-btn.active {
    background: var(--brand-green);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(46, 90, 54, 0.25);
}

.loc-tab-btn.active i {
    color: var(--brand-gold);
}

.loc-split-wrap {
    background: #ffffff;
    border-radius: 22px;
    border: 1px solid rgba(19, 38, 43, 0.08);
    box-shadow: 0 14px 40px rgba(19, 38, 43, 0.06);
    padding: 1.75rem;
}

.loc-split-map-box {
    position: relative;
    width: 100%;
    height: 410px;
    border-radius: 16px;
    overflow: hidden;
    background: #e9eeeb;
    border: 1px solid rgba(19, 38, 43, 0.08);
}

.loc-split-map-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.loc-split-details {
    padding: 0.5rem 1.25rem;
}

.loc-detail-block {
    margin-bottom: 1.55rem;
}

.loc-detail-block:last-of-type {
    margin-bottom: 1.25rem;
}

.loc-detail-heading {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--brand-dark);
    margin-bottom: 0.38rem;
}

.loc-detail-text {
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.7;
    margin-bottom: 0;
}

.loc-detail-text a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.loc-detail-text a:hover {
    color: var(--brand-green);
}

@media (max-width: 991.98px) {
    .loc-split-wrap {
        padding: 1.15rem;
    }
    .loc-split-details {
        padding: 0.5rem 0.25rem 0;
    }
    .loc-split-map-box {
        height: 320px;
    }
}

@media (max-width: 575.98px) {
    .loc-tabs-nav {
        width: 100%;
        border-radius: 16px;
        flex-direction: column;
    }
    .loc-tab-btn {
        width: 100%;
        justify-content: center;
        border-radius: 12px;
    }
}
