/*
Theme Name: Wesellhost-Cairo
Theme URI: https://wesellhost.com
Author: Wesellhost Dev Team
Author URI: https://wesellhost.com
Description: A fully custom, high-performance Bootstrap 5 RTL theme. No page builders. Includes custom projects, dynamic sliders, and WhatsApp integration.
Version: 1.2.0
Text Domain: wesellhost-cairo
*/

:root {
    --primary-color: #ff6600;
    --secondary-color: #003366;
    --accent-color: #e0a400;
    --text-dark: #333;
    --light-bg: #f8f9fa;
}

body {
    font-family: 'Cairo', sans-serif;
    overflow-x: hidden;
    color: var(--text-dark);
}

a { text-decoration: none; transition: all 0.3s ease; }
a:hover { color: var(--primary-color); }

/* =========================================
   Navbar & Header
   ========================================= */
.navbar { 
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
    padding: 15px 0; 
}
.nav-link { 
    font-weight: 600; 
    color: #333 !important; 
    margin-left: 15px; 
}
.nav-link:hover, .nav-link.active { 
    color: var(--primary-color) !important; 
}

/* =========================================
   Hero Slider (Desktop Defaults)
   ========================================= */
.carousel-item { 
    height: 75vh; 
    min-height: 500px; 
    position: relative; 
    background-color: #eee; 
}

.carousel-overlay { 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.7)); /* Darker at bottom */
    z-index: 1; 
}

.carousel-item img { 
    object-fit: cover; 
    width: 100%; 
    height: 100%; 
}

.carousel-caption { 
    bottom: 30%; 
    z-index: 2; 
}

.carousel-caption h1 { 
    font-size: 3rem; 
    font-weight: 800; 
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); 
}

/* =========================================
   Mobile Slider Optimization
   (Image Full + Overlay | Text Below | Buttons Side-by-Side)
   ========================================= */
@media (max-width: 991px) {
    /* 1. Container: Reset height to auto, standard block flow */
    .carousel-item {
        height: auto !important;
        min-height: auto !important;
        display: block !important;
        background-color: #1a1a1a; /* Background for text area */
    }

    /* 2. Image Wrapper: Relative context for the overlay */
    .carousel-item-img-wrapper {
        position: relative;
        width: 100%;
        display: block;
    }

    /* 3. Image: Natural height, no cropping */
    .carousel-item img {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        max-height: 500px; /* Optional cap */
        object-fit: contain !important;
    }

    /* 4. Overlay: Sits ON TOP of the image only */
    .carousel-overlay {
        display: block !important;
        position: absolute !important;
        top: 0; 
        left: 0;
        width: 100%; 
        height: 100%;
        background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(0,0,0,0.7) 100%) !important;
        z-index: 5;
    }

    /* 5. Caption: Sits BELOW the image */
    .carousel-caption {
        position: relative !important; /* Not absolute */
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        padding: 25px 15px !important;
        width: 100% !important;
        text-align: center !important;
        background: #1a1a1a !important; /* Dark block background */
        margin-bottom: 0 !important;
        z-index: 10;
    }

    /* 6. Typography */
    .carousel-caption h1 {
        font-size: 1.6rem !important;
        margin-bottom: 10px;
        color: #fff !important;
        line-height: 1.3;
    }
    
    .carousel-caption .description-text, 
    .carousel-caption .fs-4 {
        font-size: 1rem !important;
        color: #ccc !important;
        margin-bottom: 20px;
        display: block !important;
    }

    /* 7. Buttons: Side by Side (Flexbox) */
    .carousel-caption .mt-4 { /* The wrapper div for buttons */
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 15px !important; /* Space between buttons */
        width: 100% !important;
    }

    .carousel-caption .btn {
        flex: 1; /* Equal width */
        max-width: 160px; /* Prevent huge buttons on tablets */
        margin: 0 !important;
        padding: 10px 5px !important;
        font-size: 0.95rem !important;
        white-space: nowrap;
    }
}

/* =========================================
   Service Cards & Projects
   ========================================= */
.service-card { transition: transform 0.3s; border: none; height: 100%; }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important; }
.service-card img { width: 100%; height: 240px; object-fit: cover; border-radius: 8px; margin-bottom: 15px; }
.divider { height: 4px; width: 60px; background-color: var(--primary-color); margin: 15px auto; border-radius: 2px; }

.project-item { transition: all 0.3s ease; }
.project-item:hover { transform: translateY(-3px); }
.project-item img { transition: transform 0.5s ease; }
.project-item:hover img { transform: scale(1.05); }

/* =========================================
   General Buttons
   ========================================= */
.btn-primary { background-color: var(--primary-color); border-color: var(--primary-color); }
.btn-primary:hover { background-color: #e65c00; border-color: #e65c00; }
.btn-warning { background-color: var(--accent-color); border-color: var(--accent-color); color: #fff; }
.btn-warning:hover { background-color: #d19900; color: #fff; }

/* =========================================
   Legacy Floating Button (Hidden if FAB active)
   ========================================= */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    left: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 32px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.whatsapp-float:hover {
    background-color: #128c7e;
    color: white;
    transform: scale(1.1);
}

/* =========================================
   Modern Floating Action Bar (Mobile)
   ========================================= */
.modern-fab-container {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 350px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 65px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px;
    box-sizing: border-box;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 2px 10px rgba(0, 0, 0, 0.05);
    z-index: 9999; 
    border: 1px solid rgba(255,255,255,0.5);
    font-family: 'Cairo', sans-serif;
}

.fab-btn {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    border-radius: 40px;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s ease;
    gap: 8px;
    line-height: 1;
}

.call-btn { border: 1px dashed #d7d5d5; box-shadow: 0 4px 15px rgb(192 195 193 / 40%); color: #333; background: transparent; }
.call-btn:active, .call-btn:hover { background-color: #f0f0f0; color: #333; }

.whatsapp-btn {
    background: #25D366;
    color: white !important;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}
.whatsapp-btn:active, .whatsapp-btn:hover {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
    color: white !important;
}

.fab-divider {
    width: 1px;
    height: 25px;
    background-color: #e0e0e0;
    margin: 0 5px;
}

.fab-btn svg { width: 22px; height: 22px; display: block; }

/* Hide FAB on Desktop if you prefer */
@media (min-width: 992px) {
    /* .modern-fab-container { display: none; } */
}

/* =========================================
   Footer
   ========================================= */
footer { background-color: #222; color: #fff; padding: 70px 0 20px 0; }
footer h5 { color: #fff; font-weight: 700; margin-bottom: 20px; }
footer a { color: #bbb; }
footer a:hover { color: var(--primary-color); }
/* =========================================
   Pagination Styling (Bootstrap Override)
   ========================================= */

/* Default State (Inactive) */
.page-link { 
    color: var(--secondary-color); /* Dark Blue text */
    background-color: #fff;
    border: 1px solid #dee2e6;
    font-weight: 600;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease-in-out;
}

/* Hover State */
.page-link:hover { 
    color: var(--primary-color); /* Orange text on hover */
    background-color: #e9ecef;
    border-color: #dee2e6;
    z-index: 2;
}

/* Active State (Current Page) */
.page-item.active .page-link {
    background-color: var(--primary-color) !important; /* Orange Background */
    border-color: var(--primary-color) !important;
    color: #fff !important; /* White Text */
    z-index: 3;
}

/* Focus State (Accessibility) */
.page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 102, 0, 0.25); /* Faint Orange Glow */
    z-index: 3;
}

/* Disabled State (e.g. Prev/Next when at start/end) */
.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}
/* =========================================
   Category Badge UI Improvements
   ========================================= */

/* 1. The Badge Container */
header .badge, 
article .badge {
    background-color: var(--primary-color) !important; /* Theme Orange */
    color: #fff !important;
    
    /* Modern Styling */
    padding: 8px 20px;       /* More breathing room */
    font-size: 0.9rem;       /* Readable size */
    font-weight: 600;
    border-radius: 50px;     /* Full Pill Shape */
    line-height: 1.2;
    display: inline-block;
    
    /* Soft Shadow for depth */
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.25); 
    
    /* Smooth Animation */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid transparent;
}

/* 2. The Link Inside the Badge */
header .badge a, 
article .badge a {
    color: #ffffff !important; /* Force White Text */
    text-decoration: none !important;
    transition: color 0.2s ease;
}

/* 3. Hover Effect (UX Improvement) */
header .badge:hover, 
article .badge:hover {
    background-color: #fff !important; /* White Background */
    border-color: var(--primary-color); /* Orange Border */
    transform: translateY(-3px); /* Slight lift up */
    box-shadow: 0 6px 15px rgba(255, 102, 0, 0.3); /* Stronger shadow */
}

header .badge:hover a, 
article .badge:hover a {
    color: var(--primary-color) !important; /* Orange Text on Hover */
}
/* =========================================
   WooCommerce RTL & Gallery Fixes
   ========================================= */

/* 1. Fix Shop Grid Alignment (Start from Right) */
.woocommerce ul.products {
    direction: rtl !important;
    text-align: right !important;
    justify-content: flex-start !important; /* Ensures items start from the right in RTL */
}

/* 2. Fix Single Product Gallery (Image Visibility) */
/* Force the gallery container to LTR so the Slider JS calculates positions correctly */
.woocommerce-product-gallery,
.woocommerce-product-gallery .flex-viewport,
.woocommerce-product-gallery .woocommerce-product-gallery__image {
    direction: ltr !important;
}

/* Optional: Ensure the image inside fills the space */
.woocommerce-product-gallery img {
    width: 100% !important;
    height: auto !important;
    display: block;
}

/* 3. Fix "Sale" Badge Position inside the LTR Gallery */
/* Since we flipped the gallery to LTR, we might need to adjust the badge */
.woocommerce-product-gallery .onsale {
    left: 10px !important;
    right: auto !important; 
}
.woocommerce ul.products li.product, .woocommerce-page ul.products li.product {
    float: right;
}
/* =========================================
   Mobile Gallery Optimization
   ========================================= */

/* 1. Standard WordPress Gallery (Classic & Gutenberg) */
@media (max-width: 768px) {
    /* Force 2 columns on tablets/large phones */
    .gallery-item, 
    .blocks-gallery-item {
        width: 50% !important; 
        max-width: 50% !important;
    }
}

@media (max-width: 480px) {
    /* Force 1 column on small phones */
    .gallery-item, 
    .blocks-gallery-item {
        width: 100% !important; 
        max-width: 100% !important;
        margin: 0 0 15px 0 !important;
    }
}

/* 2. Fix Images sizing inside gallery */
.gallery-icon img, 
.blocks-gallery-item img {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px; /* Optional: Nice rounded corners */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 3. Remove default messy margins */
.gallery {
    margin-bottom: 30px !important;
}

