/* ========== خيرات المضيبي - Shared Styles & Effects ========== */
:root {
    --primary-green: #2e7d32;
    --primary-dark: #1b5e20;
    --light-bg: #f1f8e9;
    --white-bg: #ffffff;
    --text-dark: #1a237e;
    --text-muted: #455a64;
    --accent: #558b2f;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    background-color: var(--light-bg);
    color: #263238;
    overflow-x: hidden;
}

/* Language */
.lang-ar .en { display: none !important; }
.lang-en .ar { display: none !important; }

.btn-lang {
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-lang:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Navbar */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-green) 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 0.75rem 1rem;
    transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.navbar-custom.scrolled {
    background: rgba(27, 94, 32, 0.98);
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
    padding: 0.5rem 1rem;
}

.navbar-custom .navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: #fff !important;
    transition: transform 0.25s ease;
}
.navbar-custom .navbar-brand:hover {
    transform: scale(1.03);
}

.navbar-custom .nav-link {
    color: rgba(255,255,255,0.95) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-custom .nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 70%;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.3s ease;
}

.navbar-custom .nav-link:hover::after,
.navbar-custom .nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link:focus,
.navbar-custom .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.15);
}

.navbar-toggler {
    border-color: rgba(255,255,255,0.5);
}
.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255,255,255,0.3);
}
.navbar-toggler-icon {
    filter: invert(1);
}

/* Hero */
.hero {
    min-height: 85vh;
    padding-top: 76px;
    background: linear-gradient(rgba(27, 94, 32, 0.75), rgba(46, 125, 50, 0.6)), url('../images/header.jpg') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 2rem 1rem;
    position: relative;
}

.hero.hero-sm {
    min-height: 45vh;
    padding-top: 100px;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 800;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.4);
    margin-bottom: 1rem;
    opacity: 0;
    animation: heroTitleIn 0.9s ease forwards;
}

.hero .tagline {
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    opacity: 0;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    animation: heroTaglineIn 0.8s ease 0.3s forwards;
}

@keyframes heroTitleIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroTaglineIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.95;
        transform: translateY(0);
    }
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Sections */
section {
    padding: 4rem 0;
}

.section-title {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

/* Product cards */
.product-card {
    background: var(--white-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    height: 100%;
    border: 1px solid rgba(46, 125, 50, 0.12);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 48px rgba(46, 125, 50, 0.22);
}

.product-card:hover::before {
    left: 100%;
}

.product-card .card-img-wrap {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.product-card .card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.08);
}

.product-card .card-body {
    padding: 1.25rem;
}

.product-card .card-title {
    color: var(--primary-dark);
    font-weight: 700;
    font-size: 1.2rem;
}

.product-card .btn-product {
    background: linear-gradient(135deg, var(--primary-green), var(--accent));
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
}

.product-card .btn-product:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(27, 94, 32, 0.4);
}

/* About */
.about-section {
    background: var(--white-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    border: 1px solid rgba(46, 125, 50, 0.1);
    transition: box-shadow 0.3s ease;
}

.about-section:hover {
    box-shadow: 0 12px 40px rgba(46, 125, 50, 0.12);
}

.about-section p {
    color: var(--text-muted);
    line-height: 1.9;
    font-size: 1.05rem;
}

/* Contact */
.contact-card {
    background: var(--white-bg);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(46, 125, 50, 0.1);
    height: 100%;
}

.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(46, 125, 50, 0.15);
}

.contact-card i {
    font-size: 1.75rem;
    color: var(--primary-green);
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

.contact-card:hover i {
    transform: scale(1.15);
}

.contact-card a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.contact-card a:hover {
    color: var(--accent);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-green));
    color: #fff;
    padding: 1.5rem;
    text-align: center;
}

footer .footer-links,
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

/* روابط التذييل - أولوية أعلى من Bootstrap */
footer .footer-links a,
footer .footer-links a:visited,
footer .footer-links a:focus {
    color: rgba(255, 255, 255, 0.95) !important;
    text-decoration: none !important;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

footer .footer-links a:hover,
footer .footer-links a:active {
    color: #fff !important;
    text-decoration: underline !important;
}

footer .footer-links a .ar,
footer .footer-links a .en {
    color: inherit;
}

footer .footer-sep,
.footer-sep {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    -webkit-user-select: none;
    user-select: none;
}

/* Back to top */
.btn-back-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green), var(--accent));
    color: #fff;
    border: none;
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

html[dir="rtl"] .btn-back-top {
    right: auto;
    left: 24px;
}

.btn-back-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.btn-back-top:hover {
    background: var(--primary-dark);
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(27, 94, 32, 0.5);
}

.btn-back-top i {
    font-size: 1.25rem;
}

/* Page hero (for inner pages) */
.page-hero {
    background: linear-gradient(rgba(27, 94, 32, 0.8), rgba(46, 125, 50, 0.7)), url('../images/header.jpg') center/cover no-repeat;
    padding: 120px 1rem 60px;
    color: #fff;
    text-align: center;
}

.page-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

/* Product detail block (for products page) */
.product-detail {
    background: var(--white-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease;
    border: 1px solid rgba(46, 125, 50, 0.1);
}

.product-detail:hover {
    box-shadow: 0 16px 48px rgba(46, 125, 50, 0.15);
}

.product-detail .detail-img {
    height: 280px;
    object-fit: cover;
    width: 100%;
}

.product-detail .detail-body {
    padding: 1.5rem 2rem;
}

.product-detail .detail-body h3 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 1rem;
}

.product-detail .detail-body p {
    color: var(--text-muted);
    line-height: 1.8;
}

/* LTR */
body.lang-en .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

html[dir="ltr"] .navbar-custom .navbar-brand {
    margin-right: 0;
    margin-left: auto;
}

/* Focus visible for accessibility */
.navbar-custom .nav-link:focus-visible,
.btn-lang:focus-visible,
.btn-back-top:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
