/* ========================================
   HOME CSS
   Contains: Hero Slider, Glassy Header, Scroll Animations, Spacing System
   ======================================== */

/* ========================================
   0. HOMEPAGE SPACING SYSTEM
   ======================================== */
/* 
   Consistent spacing scale for homepage sections:
   - Desktop: 64px section padding
   - Tablet: 40px section padding  
   - Mobile: 28px section padding
   - Title margins: 32px desktop / 24px mobile
   - Slider margins: 40px desktop / 28px mobile
*/

/* Section Padding Overrides */
.tp-category-area,
.tp-product-area,
.tp-testimonial-area,
.tp-feature-area {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
}

/* Tablet spacing */
@media (max-width: 991px) {

    .tp-category-area,
    .tp-product-area,
    .tp-testimonial-area,
    .tp-feature-area {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
}

/* Mobile spacing */
@media (max-width: 575px) {

    .tp-category-area,
    .tp-product-area,
    .tp-testimonial-area,
    .tp-feature-area {
        padding-top: 28px !important;
        padding-bottom: 28px !important;
    }
}

/* Title Wrapper Margins - Normalize */
.tp-section-title-wrapper-2 {
    margin-bottom: 32px !important;
}

@media (max-width: 575px) {
    .tp-section-title-wrapper-2 {
        margin-bottom: 24px !important;
    }
}

/* Slider Container Margins - Normalize */
.tp-product-popular-slider-active,
.tp-makhawir-slider-active {
    margin-bottom: 40px !important;
}

@media (max-width: 575px) {

    .tp-product-popular-slider-active,
    .tp-makhawir-slider-active {
        margin-bottom: 28px !important;
    }
}

/* Product Item Bottom Margins - Remove to prevent double spacing */
.tp-product-item-2 {
    margin-bottom: 0 !important;
}

/* Swiper Scrollbar - Prevent extra bottom space */
.swiper-scrollbar {
    margin-top: 20px;
    margin-bottom: 0 !important;
}

/* Testimonial Section - Grey Background Adjustment */
.tp-testimonial-area.grey-bg-7 {
    background-color: #f8f8f8;
}

/* Feature Area - Reduce excessive padding */
.tp-feature-area {
    padding-bottom: 64px !important;
}

@media (max-width: 991px) {
    .tp-feature-area {
        padding-bottom: 40px !important;
    }
}

@media (max-width: 575px) {
    .tp-feature-area {
        padding-bottom: 28px !important;
    }
}

/* RTL Margin Fixes - Replace mr-* with ms-* for RTL */
[dir="rtl"] .mr-10,
[dir="rtl"] .tp-feature-icon-2.mr-10,
[dir="rtl"] .tp-testimonial-avater.mr-10 {
    margin-right: 0 !important;
    margin-left: 10px !important;
}

/* View All Button Spacing */
.tp-product-btn-2 {
    margin-top: 20px !important;
    margin-bottom: 0 !important;
}

/* ========================================
   1. HERO SLIDER CSS
   ======================================== */
/* ========================================
   HERO SLIDER - FULLY RESPONSIVE
   ======================================== */

/* Container */
.ghain-hero-slider {
    position: relative;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    overflow: hidden;
    /* Mobile: content-driven height */
    height: auto;
    min-height: auto;
    aspect-ratio: 16/9;
}

/* Phone screens only - no extra margin needed, body padding handles header */
@media (max-width: 575px) {
    .ghain-hero-slider {
        margin-top: 0;
    }
}

/* Tablet and up: increased height */
@media (min-width: 768px) {
    .ghain-hero-slider {
        position: relative;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        height: clamp(600px, 85vh, 800px);
        aspect-ratio: auto;
        /* Reset aspect ratio for larger screens */
    }
}

/* Desktop: larger height */
@media (min-width: 1024px) {
    .ghain-hero-slider {
        height: clamp(700px, 90vh, 950px);
    }
}

/* Video Container */
.ghain-hero-video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Video player div */
#hero-video-player {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    border: none;
}

/* Video iframe inside the player */
#hero-video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

/* Ensure video covers the entire container */
/* Case 1: Screen is wider than 16:9 - Fit to width, crop height */
@media (min-aspect-ratio: 16/9) {
    #hero-video-player {
        width: 100vw !important;
        height: 56.25vw !important;
        /* 100 * 9/16 */
    }
}

/* Case 2: Screen is taller than 16:9 - Fit to height, crop width */
@media (max-aspect-ratio: 16/9) {
    #hero-video-player {
        width: auto !important;
        height: 100% !important;
        aspect-ratio: 16/9;
    }
}

/* Swiper Container */
.ghain-hero-slider .swiper-container {
    width: 100%;
    height: 100%;
}

/* Individual Slide */
.ghain-hero-slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background Image */
.ghain-hero-slide__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
}

/* Very Light Gradient Overlay for Readability */
.ghain-hero-slide__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.2) 0%,
            rgba(0, 0, 0, 0.2) 100%);
    z-index: 2;
}

/* Content Container */
.ghain-hero-slide__content {
    position: relative;
    z-index: 3;
    width: 100%;
    height: 100%;
    /* Make full height */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 3rem);
    color: #fff;
    text-align: right;
    /* RTL alignment */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Push content to bottom */
    align-items: flex-start;
    /* Align to start (right in RTL) */
    padding-bottom: 200px;
}

/* Mobile: center or left aligned with safe padding */
@media (max-width: 767px) {
    .ghain-hero-slide__content {
        text-align: center;
        padding: 0 1rem 1rem;
        /* Considerably reduce bottom padding */
        justify-content: center;
        /* Center content vertically */
        padding-bottom: 2rem;
    }
}

/* Badge/Label */
.ghain-hero-slide__badge {
    display: inline-block;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Headline (H1) - Fluid Typography */
.ghain-hero-slide__title {
    font-size: clamp(1.75rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: clamp(0.75rem, 2vw, 1.25rem);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Description */
.ghain-hero-slide__description {
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    line-height: 1.6;
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
    max-width: 600px;
    opacity: 0.95;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 767px) {
    .ghain-hero-slide__description {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Shop Text above CTA */
.ghain-hero-shop-text {
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: clamp(0.75rem, 1.5vw, 1.5rem);
    font-weight: 500;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* CTA Buttons Container */
.ghain-hero-slide__cta {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1rem);
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .ghain-hero-slide__cta {
        justify-content: center;
    }
}

/* Primary CTA Button */
.ghain-hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.625rem, 1.5vw, 0.875rem) clamp(1.25rem, 3vw, 2rem);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    min-height: 40px;
    /* Touch target size */
    cursor: pointer;
    border: 2px solid transparent;
}

.ghain-hero-btn--primary {
    background: var(--tp-theme-primary, #e74c3c);
    color: #fff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.ghain-hero-btn--primary:hover {
    background: var(--tp-theme-primary-hover, #c0392b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.ghain-hero-btn--secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

.ghain-hero-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    transform: translateY(-2px);
}

/* Navigation Arrows */
.ghain-hero-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    background: transparent;
    border: 1px solid #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--tp-theme-primary, #e74c3c);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.ghain-hero-arrow:hover {
    background: #fff;
    color: var(--tp-theme-primary, #e74c3c);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.ghain-hero-arrow--prev {
    left: clamp(1rem, 3vw, 2rem);
}

.ghain-hero-arrow--next {
    right: clamp(1rem, 3vw, 2rem);
}

/* Hide arrows on very small screens */
@media (max-width: 480px) {
    .ghain-hero-arrow {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
}

/* Pagination Dots */
.ghain-hero-dots {
    position: absolute;
    bottom: clamp(1.5rem, 4vw, 2.5rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 0.5rem;
}

.ghain-hero-dots .swiper-pagination-bullet {
    width: clamp(8px, 2vw, 12px);
    height: clamp(8px, 2vw, 12px);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.ghain-hero-dots .swiper-pagination-bullet-active {
    background: #fff;
    width: clamp(24px, 4vw, 32px);
    border-radius: 6px;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ghain-hero-slider * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Disable autoplay via JS, but also hide transition effects */
    .ghain-hero-slide {
        transition: none !important;
    }
}

/* Accessibility: Focus States */
.ghain-hero-btn:focus,
.ghain-hero-arrow:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* Loading State */
.ghain-hero-slider.loading .ghain-hero-slide__bg {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.ghain-hero-slider.loaded .ghain-hero-slide__bg {
    opacity: 1;
}

/* ========================================
   HERO SIDE FLYING IMAGES
   ======================================== */

/* Container for side images */
.ghain-hero-side-images {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
    pointer-events: none;
}

/* Individual side image */
.ghain-hero-side-img {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(150px, 15vw, 250px);
    height: auto;
    object-fit: contain;
    opacity: 0.9;
    /* Hidden on mobile by default */
    display: none;
}

/* Show on medium screens and up (tablets and desktops) */
@media (min-width: 768px) {
    .ghain-hero-side-img {
        display: block;
    }
}

/* Left side image */
.ghain-hero-side-img--left {
    left: 0;
    animation: flyLeft 3s linear infinite;
}

/* Right side image */
.ghain-hero-side-img--right {
    right: 0;
    animation: flyRight 3s linear infinite;
}

/* Flying animation for left image */
@keyframes flyLeft {

    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }

    50% {
        transform: translateY(calc(-50% - 20px)) translateX(0);
    }
}

/* Flying animation for right image */
@keyframes flyRight {

    0%,
    100% {
        transform: translateY(-50%) translateX(0);
    }

    50% {
        transform: translateY(calc(-50% + 20px)) translateX(0);
    }
}

/* Adjust size for larger screens */
@media (min-width: 1200px) {
    .ghain-hero-side-img {
        width: clamp(200px, 18vw, 300px);
    }
}

/* ========================================
   2. GLASSY HEADER CSS
   ======================================== */
/* Glassy Header Styles */

/* Default state - Glassy effect */
.tp-header-bottom-2 {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease-in-out;
}

/* Logo styling for glassy header */
.tp-header-bottom-2 .logo img {
    max-width: 170px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    transition: filter 0.3s ease-in-out;
}

/* Menu links styling for glassy header */
.tp-header-bottom-2 .main-menu nav ul li a {
    color: var(--tp-common-black);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease-in-out;
}

/* Header action icons for glassy header */
.tp-header-bottom-2 .tp-header-action-btn {
    color: var(--tp-common-black);
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.8));
    transition: all 0.3s ease-in-out;
}

/* Sticky state - White background */
.tp-header-sticky.header-sticky {
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.08);
}

/* Remove text shadow when sticky */
.tp-header-sticky.header-sticky .main-menu nav ul li a {
    text-shadow: none;
}

/* Remove drop shadow from logo when sticky */
.tp-header-sticky.header-sticky .logo img {
    filter: none;
}

/* Remove drop shadow from icons when sticky */
.tp-header-sticky.header-sticky .tp-header-action-btn {
    filter: none;
}

/* Submenu styling for glassy header */
.tp-header-bottom-2 .tp-submenu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Submenu links */
.tp-header-bottom-2 .tp-submenu li a {
    text-shadow: none;
}

/* Hamburger menu icon */
.tp-header-bottom-2 .tp-offcanvas-open-btn {
    color: var(--tp-common-black);
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.8));
}

.tp-header-sticky.header-sticky .tp-offcanvas-open-btn {
    filter: none;
}

/* Badge styling */
.tp-header-action-badge {
    background: var(--tp-theme-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Smooth transition for header height */
.tp-header-bottom-2 {
    padding-top: 5px;
    padding-bottom: 5px;
    transition: padding 0.3s ease-in-out, background 0.3s ease-in-out;
}

.tp-header-sticky.header-sticky {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* Ensure header is positioned correctly */
/* Header CSS Section */
.tp-header-area {
    position: relative;
    z-index: 999;
}

/* Make header sticky from the start */
.tp-header-bottom-2 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999;
}

/* Add padding to body to prevent content from hiding under header */
body {
    padding-top: 55px;
}

/* Responsive adjustments */
@media only screen and (max-width: 1199px) {
    body {
        padding-top: 50px;
    }
}

@media only screen and (max-width: 767px) {
    body {
        padding-top: 120px;
    }

    .tp-header-bottom-2 {
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .tp-header-sticky.header-sticky {
        padding-top: 3px;
        padding-bottom: 3px;
    }

    /* Center the hamburger menu icon on phone screens */
    .tp-header-bottom-right {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .tp-header-action {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .tp-header-hamburger {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* ========================================
   3. SCROLL ANIMATIONS CSS
   ======================================== */
/* Scroll Animation Styles */

/* Initial state - sections are hidden */
.scroll-animate {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Active state - sections are visible */
.scroll-animate.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* Delay variations for staggered animations */
.scroll-animate.delay-1 {
    transition-delay: 0.1s;
}

.scroll-animate.delay-2 {
    transition-delay: 0.2s;
}

.scroll-animate.delay-3 {
    transition-delay: 0.3s;
}

/* Alternative animation: Fade in from left */
.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate-left.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Alternative animation: Fade in from right */
.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* Scale animation */
.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.scroll-animate-scale.animate-in {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   TESTIMONIAL ARROWS - SEPARATE SIDES
   ======================================== */
/* Override default centering to push arrows to edges */
.tp-testimonial-arrow {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    /* Add some spacing from screen edges */
    z-index: 10;
    pointer-events: none;
    /* Allow clicking through the container */
}

/* Ensure buttons are clickable */
.tp-testimonial-arrow button {
    pointer-events: auto;
    position: static;
    /* Reset absolute positioning if any */
    transform: none !important;
    /* Reset existing transforms if any */
    margin: 0 !important;
}

/* RTL Support for arrows */
[dir="rtl"] .tp-testimonial-arrow {
    flex-direction: row-reverse;
}

/* Hide on mobile if needed (already likely hidden via d-none d-md-block) */
/* Hide on mobile if needed (already likely hidden via d-none d-md-block) */
@media (max-width: 767px) {
    .tp-testimonial-arrow {
        display: none;
    }
}

/* ========================================
   TESTIMONIAL ARROWS - SEPARATE SIDES (FIX)
   ======================================== */
/* Reset container layout */
.tp-testimonial-arrow {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 0;
    z-index: 10;
    pointer-events: none;
    display: block;
    /* Ensure it's not flex anymore */
    padding: 0;
}

/* Ensure buttons are clickable and positioned absolutely */
.tp-testimonial-arrow button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    margin: 0 !important;
}

/* Previous Button -> Left Side */
.tp-testimonial-slider-button-prev {
    left: 40px;
    right: auto;
}

/* Next Button -> Right Side */
.tp-testimonial-slider-button-next {
    right: 40px;
    left: auto;
}

/* RTL Specific - Force Physical positioning if needed */
[dir="rtl"] .tp-testimonial-slider-button-prev {
    left: 40px;
    right: auto;
}

[dir="rtl"] .tp-testimonial-slider-button-next {
    right: 40px;
    left: auto;
}