/* ==========================================================================
   GYMOLD Factory - Master Responsive Stylesheet
   ========================================================================== */

:root {
    --primary: #111827;
    --primary-light: #1f2937;
    --accent: #e65100;
    --accent-hover: #c94600;
    --whatsapp: #25d366;
    --whatsapp-hover: #1eb954;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Tajawal', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* الأزرار العامة */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-orange {
    background-color: var(--accent);
    color: #fff;
}

.btn-orange:hover {
    background-color: var(--accent-hover);
}

.btn-outline {
    border: 2px solid #fff;
    color: #fff;
    background: transparent;
}

.btn-outline:hover {
    background: #fff;
    color: var(--primary);
}

.btn-outline-dark {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-dark:hover {
    background: var(--primary);
    color: #fff;
}

.btn-large {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
}

.badge {
    display: inline-block;
    background: #fff3e0;
    color: var(--accent);
    border: 1px solid #ffe0b2;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
}

/* ==========================================================================
   الهيدر وشريط التنقل المتجاوب
   ========================================================================== */
.main-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 75px;
}

.logo a {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary);
}

.brand-sub {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 700;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 15px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--accent);
}

/* زر همبرغر الموبايل */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: var(--primary);
    cursor: pointer;
    padding: 5px;
}

/* ==========================================================================
   قسم الواجهة (Hero Section)
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 70px 0;
}

.hero-container-split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
}

.hero-content h1 {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #cbd5e1;
    margin-bottom: 25px;
}

.hero-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-video-box {
    text-align: center;
}

.video-frame {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    background: #000;
}

.video-frame video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.video-caption {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* ==========================================================================
   شريط الإحصائيات
   ========================================================================== */
.stats-section {
    background: #fff;
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    text-align: center;
    padding: 15px;
    border-radius: var(--radius);
    background: var(--bg-light);
    border: 1px solid var(--border);
}

.stat-card h3 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==========================================================================
   كتالوج المنتجات
   ========================================================================== */
.pdf-catalog-section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 45px;
}

.section-title h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.section-title p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.catalog-category-block {
    margin-bottom: 45px;
}

.category-block-title {
    background: var(--primary);
    color: #fff;
    padding: 12px 18px;
    font-size: 1.15rem;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 20px;
}

.catalog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.card-img-box {
    width: 100%;
    height: 200px;
    background: #e2e8f0;
}

.card-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-gallery {
    display: flex;
    gap: 8px;
    padding: 10px 15px 0 15px;
}

.thumb-gallery img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: 0.2s;
}

.thumb-gallery img.active,
.thumb-gallery img:hover {
    border-color: var(--accent);
    opacity: 1;
}

.card-body {
    padding: 15px;
    flex-grow: 1;
}

.cat-tag {
    display: inline-block;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.catalog-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--primary);
}

.catalog-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ==========================================================================
   مجالات القوالب
   ========================================================================== */
.categories-section {
    background: #fff;
    padding: 60px 0;
    border-top: 1px solid var(--border);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.card-icon {
    font-size: 1.6rem;
}

.category-card h3 {
    font-size: 1rem;
    color: var(--primary);
}

.category-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex-grow: 1;
}

.card-footer {
    margin-top: 15px;
}

.card-link {
    text-decoration: none;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
}

/* ==========================================================================
   مكتبة الفيديوهات
   ========================================================================== */
.gallery-section {
    padding: 60px 0;
}

.search-filter-wrapper {
    max-width: 600px;
    margin: 0 auto 20px auto;
}

.search-filter-wrapper input {
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.95rem;
    outline: none;
}

.search-filter-wrapper input:focus {
    border-color: var(--accent);
}

.gallery-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.filter-btn {
    background: #fff;
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    transition: 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-wrapper video {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #000;
}

.video-info {
    padding: 12px 15px;
}

.video-info h4 {
    font-size: 0.95rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.video-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.load-more-wrapper {
    text-align: center;
    margin-top: 35px;
}

/* ==========================================================================
   التخصيص، المواد، والتواصل
   ========================================================================== */
.customization-section {
    background: #fff;
    padding: 60px 0;
}

.customization-wrapper,
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.customization-content h2,
.contact-info h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.steps-grid {
    display: grid;
    gap: 15px;
    margin-top: 25px;
}

.step-item {
    display: flex;
    gap: 15px;
    align-items: center;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    flex-shrink: 0;
}

.step-text h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.step-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.customization-card,
.contact-form-card {
    background: var(--bg-light);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: var(--radius);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    font-size: 0.9rem;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.materials-section {
    padding: 60px 0;
}

.materials-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.material-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px 20px;
    position: relative;
}

.material-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 0.75rem;
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.material-card h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    margin-top: 10px;
}

.material-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.info-items {
    display: grid;
    gap: 20px;
    margin-top: 25px;
}

.info-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.info-icon {
    font-size: 1.5rem;
}

.info-item h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.info-item p, .info-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}

/* الفوتر */
.main-footer {
    background: var(--primary);
    color: #fff;
    padding: 50px 0 20px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-about h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.footer-about p {
    color: #94a3b8;
    font-size: 0.85rem;
    line-height: 1.6;
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
    display: grid;
    gap: 8px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.85rem;
    transition: 0.2s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.8rem;
}

/* زر الواتساب العائم */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--whatsapp);
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.whatsapp-float:hover {
    background: var(--whatsapp-hover);
    transform: translateY(-2px);
}

/* ==========================================================================
   استعلامات الوسائط (Media Queries التجاوب مع الجوال والتابلت)
   ========================================================================== */

/* أجهزة التابلت والشاشات المتوسطة (أقل من 992px) */
@media (max-width: 992px) {
    .hero-container-split,
    .customization-wrapper,
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .materials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* أجهزة الجوال والشاشات الصغيرة (أقل من 768px) */
@media (max-width: 768px) {
    .header-cta {
        display: none; /* إخفاء زر الهيدر لفسح المجال للمنيو */
    }

    .mobile-menu-toggle {
        display: block; /* إظهار زر الهمبرغر */
    }

    .nav-menu {
        position: fixed;
        top: 75px;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 75px);
        background: #ffffff;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: 0.3s ease-in-out;
        padding: 25px 20px;
        overflow-y: auto;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .nav-menu a {
        font-size: 1.05rem;
        display: block;
        width: 100%;
    }

    .hero-section {
        padding: 40px 0;
    }

    .hero-content h1 {
        font-size: 1.65rem;
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    .hero-btns {
        flex-direction: column;
    }

    .hero-btns .btn {
        width: 100%;
    }

    .stats-container {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .catalog-grid,
    .video-grid,
    .materials-grid {
        grid-template-columns: 1fr;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .customization-card,
    .contact-form-card {
        padding: 20px 15px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .whatsapp-float {
        bottom: 15px;
        left: 15px;
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   تنسيقات الطباعة واستخراج PDF التلقائي
   ========================================================================== */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm 12mm;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-shadow: none !important;
    }

    body {
        background: #fff !important;
        color: #0f172a !important;
        font-size: 11pt;
    }

    .main-header,
    .hero-video-box,
    .hero-btns,
    .search-filter-wrapper,
    .gallery-filter,
    .load-more-wrapper,
    #gallery,
    .customization-card,
    .contact-form-card,
    .main-footer,
    .whatsapp-float,
    .thumb-gallery,
    .btn {
        display: none !important;
    }

    .hero-section {
        background: none !important;
        color: #000 !important;
        padding: 0 0 15px 0 !important;
        border-bottom: 2px solid #e65100;
        margin-bottom: 20px;
    }

    .hero-content h1 {
        font-size: 18pt !important;
        color: #111827 !important;
    }

    .stats-container {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
    }

    .stat-card {
        border: 1px solid #cbd5e1 !important;
        padding: 8px !important;
        background: #f8fafc !important;
    }

    .catalog-category-block {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }

    .category-block-title {
        background: #111827 !important;
        color: #fff !important;
        padding: 6px 12px !important;
        font-size: 12pt !important;
    }

    .catalog-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .catalog-card {
        border: 1px solid #cbd5e1 !important;
        padding: 8px !important;
        display: flex !important;
        flex-direction: row !important;
        gap: 10px !important;
        page-break-inside: avoid;
    }

    .catalog-card .card-img-box {
        width: 75px !important;
        height: 75px !important;
    }

    .materials-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
        page-break-inside: avoid;
    }
}
/* ==========================================================================
   تنسيقات نافذة تكبير الصور (Lightbox Modal)
   ========================================================================== */
.card-img-box img {
    cursor: zoom-in;
    transition: transform 0.25s ease;
}

.card-img-box:hover img {
    transform: scale(1.03);
}

.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.image-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-dialog {
    position: relative;
    width: 50vw; /* يأخذ نصف عرض الشاشة تماماً */
    max-width: 700px;
    max-height: 85vh;
    background: #ffffff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: zoomIn 0.25s ease;
}

.lightbox-dialog img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-caption {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
}

.lightbox-close-btn {
    position: absolute;
    top: -14px;
    left: -14px;
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: transform 0.2s;
}

.lightbox-close-btn:hover {
    transform: scale(1.1);
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ضبط حجم التكبير على شاشات الجوال */
@media (max-width: 768px) {
    .lightbox-dialog {
        width: 90vw; /* توسيع العرض على شاشات الجوال ليكون مريحاً للرؤية */
        padding: 10px;
    }
}