﻿/* ========================================
   SERVICES CAROUSEL - Complete Styles
   Author: DCA Web Development Team
   Fixed: Carousel + Left Alignment
======================================== */
 

/* ========================================
   SECTION HEADER - LEFT ALIGNED
======================================== */
.section-intro {
    text-align: left;
    margin-bottom: 10px;
    z-index:100;
}

.explore-text {
    font-size: 1rem;
    color: var(--text-contain, #666);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 15px;
}

    .explore-text::after {
        content: "";
        display: inline-block;
        width: 60px;
        height: 2px;
        background: #c41e3a;
        vertical-align: middle;
    }

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

    .section-header h2 {
         
        color: var(--text-contain, #231f20);
        margin: 0;
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-all-btn {
    background: white;
    color: var(--text-contain, #231f20);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

    .view-all-btn:hover {
        background: white;
        color: #c41e3a;
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(196, 30, 58, 0.2);
    }

/* ========================================
   CAROUSEL CONTAINER
======================================== */
.services-carousel-container {
    overflow: visible; /* Allow hover effects */
    position: relative;
    width: 100%;
    padding: 20px 0 40px 0;
}

/* 
   CRITICAL CALCULATION:
   - 4 cards visible at once
   - Card width: 265px
   - Gap: 30px
   - Visible width: (4 × 265) + (3 × 30) = 1060 + 90 = 1150px
   - Added padding for hover effects
*/
.services-grid-wrapper {
    width: 1150px;
    max-width: 100%;
    overflow-x: clip; /* Clip horizontally but allow vertical hover effects */
    overflow-y: visible;
    margin: 0; /* LEFT ALIGNED */
    padding: 20px 0; /* Vertical padding for hover scale */
}

/*
   SLIDE CALCULATION:
   - 12 cards total, 4 per slide = 3 slides
   - Each slide shift: (4 × 265) + (4 × 30) = 1180px
   - Slide 0: transform: translateX(0)
   - Slide 1: transform: translateX(-1180px)
   - Slide 2: transform: translateX(-2360px)
*/
.services-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 30px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    margin: 0;
    will-change: transform;
}

    /* Slide positions - controlled by JS */
    .services-grid[data-slide="0"] {
        transform: translateX(0);
    }

    .services-grid[data-slide="1"] {
        transform: translateX(-1180px);
    }

    .services-grid[data-slide="2"] {
        transform: translateX(-2360px);
    }

/* ========================================
   SERVICE CARDS - FIXED SIZE
======================================== */
.service-card {
    background: #f8f8f8;
    color: #333;
    padding: 30px 25px;
    border-radius: 12px;
    text-align: left;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    /* FIXED dimensions - SQUARE 265x265 */
    /*flex: 0 0 265px;
    width: 265px;
    min-width: 265px;
    max-width: 265px;*/
    height: 265px;
    min-height: 265px;
    max-height: 265px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    user-select: none;
    -webkit-user-select: none;
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 100%;
}

.service-card {
    /* Remove fixed width constraints - let grid handle it */
    /* flex: 0 0 265px;      ← REMOVE */
    /* width: 265px;          ← REMOVE */
    /* min-width: 265px;      ← REMOVE */
    /* max-width: 265px;      ← REMOVE */
    height: 265px;
    min-height: 265px;
    max-height: 265px;
}

/* Tablet: 3 + 2 layout */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile: 2 columns */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-card {
        height: 220px;
        min-height: 220px;
        max-height: 220px;
    }
}

/* Small mobile: single column */
@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}
    .service-card:hover {
        background: #c82333;
        color: white;
        transform: translateY(-10px) scale(1.02);
        box-shadow: 0 15px 40px rgba(200, 35, 51, 0.3);
    }

/* Service Icon */
.all-service-icon {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    max-width: 60px;
    max-height: 60px;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
}

    .all-service-icon i,
    .all-service-icon .material-symbols-outlined {
        font-size: 28px;
        color: #000000;
        transition: all 0.3s ease;
    }

.service-card:hover .all-service-icon i,
.service-card:hover .all-service-icon span,
.service-card:hover .all-service-icon .material-symbols-outlined {
    color: #c02026 !important;
}

[dir="rtl"] .service-card:hover .all-service-icon i,
[dir="rtl"] .service-card:hover .all-service-icon span,
[dir="rtl"] .service-card:hover .all-service-icon .material-symbols-outlined {
    color: #c02026 !important;
}

.service-card:hover .all-service-icon {
    background: rgba(255, 255, 255, 1);
    color: #c02026;
     
}

     

/* Service Title */
.service-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.4;
    min-height: 50px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    color: #231f20;
    transition: color 0.3s ease;
}

.service-card:hover h3 {
    color: white;
}

/* Service Link */
.service-link {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: auto;
    align-self: flex-start;
}

    .service-link i {
        font-size: 14px;
        transition: transform 0.3s ease;
    }

    .service-link:hover i {
        transform: translateX(3px);
    }

.service-card:hover .service-link {
    color: white;
}

    .service-card:hover .service-link i {
        transform: translateX(5px);
    }

/* ========================================
   PAGINATION DOTS - CENTERED
======================================== */
.services-pagination {
    display: flex;
    justify-content: center; /* CENTERED */
    align-items: center;
    gap: 15px;
    margin: 40px 0 20px 0;
    padding: 20px 0;
}

.pagination-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(196, 30, 58, 0.3);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    position: relative;
}

    .pagination-dot::after {
        content: '';
        position: absolute;
        inset: -4px;
        border-radius: 50%;
        border: 2px solid transparent;
        transition: all 0.3s ease;
    }

    .pagination-dot:hover {
        background: rgba(196, 30, 58, 0.5);
        transform: scale(1.2);
        border-color: rgba(196, 30, 58, 0.7);
    }

        .pagination-dot:hover::after {
            border-color: rgba(196, 30, 58, 0.2);
        }

    .pagination-dot.active {
        background: #c41e3a;
        border-color: #c41e3a;
        transform: scale(1.4);
        box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.2);
    }

    .pagination-dot:focus {
        outline: 2px solid #c41e3a;
        outline-offset: 4px;
    }

/* ========================================
   LOADING & ERROR STATES
======================================== */
.services-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 60px 20px;
}

    .services-loading .spinner-border {
        width: 3rem;
        height: 3rem;
        color: #c41e3a;
        border-width: 0.25rem;
    }

.services-error {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

    .services-error p {
        font-size: 1.1rem;
        margin: 0;
    }

/* ========================================
   RTL SUPPORT
======================================== */
[dir="rtl"] .services .container {
    direction: rtl;
}

[dir="rtl"] .section-intro {
    text-align: right;
}

[dir="rtl"] .explore-text::after {
    order: -1;
}

[dir="rtl"] .services-grid-wrapper {
    margin-left: auto;
    margin-right: 0;
}

[dir="rtl"] .services-grid {
    direction: ltr; /* Keep carousel LTR for consistent sliding */
}


[dir="rtl"] .service-card {
    direction: rtl;
    text-align: right !important;
    align-items: flex-start !important;
}

    [dir="rtl"] .service-card h3 {
        text-align: right !important;
        justify-content: flex-start !important;
        width: 100%;
    }

[dir="rtl"] .service-link {
    align-self: flex-start !important;
    width: auto;
    margin-left: auto !important;
    margin-right: 0 !important;
}

[dir="rtl"] .service-card:hover .service-link {
    color: white !important;
}

[dir="rtl"] .all-service-icon {
    margin: 0 0 15px 0 !important;
    max-width: 60px;
    max-height: 60px;
    width: 60px;
    height: 60px;    
    
    direction: ltr;
    display: flex;
    align-items: center;
    justify-content: center;
}

    [dir="rtl"] .all-service-icon .material-symbols-outlined {
        direction: ltr !important;
        unicode-bidi: bidi-override;
        text-rendering: optimizeLegibility;
        -webkit-font-feature-settings: "liga";
        font-feature-settings: "liga";
    }

  

 
 
 

[dir="rtl"] .services-pagination {
    justify-content: center;
}
[dir="rtl"] .service-link i,
[dir="rtl"] .service-link .material-symbols-outlined {
    transform: scaleX(-1);
    order: 1;
}

[dir="rtl"] .service-link:hover i,
[dir="rtl"] .service-link:hover .material-symbols-outlined {
    transform: scaleX(-1) translateX(-5px);
}

[dir="rtl"] .service-card:hover .service-link i,
[dir="rtl"] .service-card:hover .service-link .material-symbols-outlined {
    color: white !important;
    transform: scaleX(-1) translateX(-5px);
}
/* RTL Hover States - Ensure white text */
/* RTL Hover States - Ensure white text */
[dir="rtl"] .service-card:hover {
    background: #c82333 !important;
    color: white !important;
}

    [dir="rtl"] .service-card:hover h3 {
        color: white !important;
    }

    [dir="rtl"] .service-card:hover .service-link {
        color: white !important;
    }

    [dir="rtl"] .service-card:hover .all-service-icon {
        background: rgba(255, 255, 255, 1) !important;
        
    }

        [dir="rtl"] .service-card:hover .all-service-icon .material-symbols-outlined {
            color: #c02026 ;
        }

/* ========================================
   RESPONSIVE - TABLET (3 cards visible)
======================================== */
@media (max-width: 1200px) {
    .services-grid-wrapper {
        /* 3 cards: (3 × 240) + (2 × 25) = 770px */
        width: 770px;
        padding: 0;
    }

    .service-card {
        flex: 0 0 240px;
        width: 240px;
        min-width: 240px;
        max-width: 240px;
    }

    .services-grid {
        gap: 25px;
    }

        /* Recalculate slide positions for 3 cards */
        /* Shift: (3 × 240) + (3 × 25) = 795px */
        .services-grid[data-slide="0"] {
            transform: translateX(0);
        }

        .services-grid[data-slide="1"] {
            transform: translateX(-795px);
        }

        .services-grid[data-slide="2"] {
            transform: translateX(-1590px);
        }

        .services-grid[data-slide="3"] {
            transform: translateX(-2385px);
        }

    .all-service-icon {
        width: 60px;
        height: 60px;
    }

        .all-service-icon i {
            font-size: 28px;
        }

    .service-card h3 {
        font-size: 1.05rem;
        min-height: 50px;
    }
}

/* ========================================
   RESPONSIVE - MOBILE (Stack vertically)
======================================== */
@media (max-width: 968px) {
    .services {
        margin: 60px 0;
        padding: 60px 0;
    }

    .section-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        margin-bottom: 40px;
    }

    .section-intro {
        text-align: center;
    }

    .explore-text::after {
        display: none;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .services-carousel-container {
        padding: 10px 0;
    }

    .services-grid-wrapper {
        width: 100%;
        padding: 0 10px;
        overflow: visible;
    }

    .services-grid {
        flex-direction: column;
        gap: 20px;
        transform: none !important; /* Disable carousel on mobile */
    }

    .service-card {
        flex: 1;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        min-height: 240px;
        margin: 0;
    }

    .services-pagination {
        display: none; /* Hide pagination on mobile */
    }

    .all-service-icon {
        width: 60px;
        height: 60px;
    }

        .all-service-icon i {
            font-size: 26px;
        }

    .service-card h3 {
        font-size: 1rem;
        min-height: auto;
    }

    .service-link {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .section-header h2 {
        font-size: 1.8rem;
    }

    .service-card {
        padding: 30px 20px;
        min-height: 220px;
    }

    .view-all-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .services {
        margin: 40px 0;
        padding: 40px 0;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .service-card {
        padding: 25px 15px;
        min-height: 200px;
    }

        .service-card h3 {
            font-size: 0.95rem;
        }
}

/* ========================================
   ACCESSIBILITY
======================================== */
@media (prefers-reduced-motion: reduce) {
    .services-grid,
    .service-card,
    .pagination-dot,
    .all-service-icon {
        transition: none !important;
    }
}

@media (prefers-contrast: high) {
    .service-card {
        border: 2px solid #000;
    }

    .pagination-dot {
        border-width: 3px;
    }

        .pagination-dot.active {
            border-color: #000;
            background: #000;
        }
}

/* ========================================
   PRINT STYLES
======================================== */
@media print {
    .services-carousel-container {
        overflow: visible;
    }

    .services-grid-wrapper {
        width: 100%;
        overflow: visible;
    }

    .services-grid {
        flex-wrap: wrap;
        transform: none !important;
    }

    .services-pagination {
        display: none;
    }

    .service-card {
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
/* Material Symbols RTL Fix - Preserve ligatures */
[dir="rtl"] .material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 28px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr !important;
    unicode-bidi: bidi-override;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
[dir="rtl"] .service-link::after {
    
    margin-right: 8px;
    margin-left: 0;
}

[dir="rtl"] .service-link::before {
    content: none;
}