/* AlloDentiste Services Widget Styles */

.allo-services-widget {
    background-color: #F5F5F5;
    padding: 80px 0;
    overflow: hidden;
}

.services-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--allo-gutter);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: grid;
    grid-template-rows: 2fr 1fr;
    min-height: 700px;
}

/* White horizontal divider bar between rows */
.services-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background-color: #FFFFFF;
    z-index: 1;
    top: 66.66%;
}

/* Top Row Container */
.services-top-row {
    grid-row: 1;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 0;
    position: relative;
}

/* Vertical divider between top row columns */
.services-top-row::after {
    content: '';
    position: absolute;
    left: 33.33%;
    top: 0;
    bottom: 0;
    width: 6px;
    background-color: #FFFFFF;
    z-index: 1;
}

/* Left Column in Top Row */
.services-header-column {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 0;
    position: relative;
}

/* Horizontal divider in left column */
.services-header-column::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    background-color: #FFFFFF;
    top: 50%;
    z-index: 1;
}

/* Header Section - Top of Left Column */
.header-section {
    padding: 20px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.services-top-text {
    font-size: 18px;
    font-style: italic;
    color: #1A1A1A;
    font-weight: 400;
}

/* Main Heading Section - Bottom of Left Column */
.heading-section {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.services-heading {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.2;
    color: #1A1A1A;
    margin: 0;
}

/* Right Column - Empty for Background */
.services-background-column {
    /* Just shows the background image */
}

/* Service Cards Row - Bottom */
.services-cards-row {
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
}

/* Vertical dividers between cards */
.service-card-wrapper {
    position: relative;
    padding: 15px;
}

/* Removed vertical dividers - cards now have spacing instead */

.service-card {
    padding: 50px 40px;
    min-height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.35) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    border-radius: 16px;
    will-change: transform;
    transform: translateZ(0);
}

/* Default Content */
.card-default-content {
    opacity: 1;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    min-height: 100%;
}

.service-card-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    color: #1A1A1A;
    margin: 0;
}

/* Hover Content */
.card-hover-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(10px) translateZ(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 16px;
    will-change: opacity, transform;
}

.service-card:hover .card-default-content {
    opacity: 0;
}

.service-card:hover .card-hover-content {
    opacity: 1;
    transform: translateY(0) translateZ(0);
    pointer-events: auto;
}

.card-hover-content .service-card-title {
    margin-bottom: 15px;
    color: #1A1A1A;
    font-size: 24px;
}

.service-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666666;
    margin: 0 0 20px 0;
    flex: 0 0 auto;
    max-height: 68px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    position: relative;
    transition: all 0.3s ease;
}

.service-description:hover {
    -webkit-line-clamp: unset;
    display: block;
    overflow-y: hidden;
    scroll-behavior: smooth;
}

.service-description::-webkit-scrollbar {
    width: 0;
    display: none;
}

.service-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px 3px 8px;
    background-color: #00A1AD !important;
    color: #FFFFFF !important;
    text-decoration: none;
    border: none;
    border-radius: 24px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.service-button:hover {
    background-color: #008A95 !important;
    color: #FFFFFF !important;
}

/* Arrow icon after button text */
.service-button::after {
    content: '';
    width: 24px;
    height: 24px;
    background-color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%2300A1AD" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M17 7H7M17 7V17"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .services-container {
        grid-template-rows: auto auto;
        min-height: 600px;
    }
    
    .services-container::before {
        top: 50%;
    }
    
    .services-top-row {
        grid-template-columns: 1fr;
    }
    
    .services-top-row::after {
        display: none;
    }
    
    .services-heading {
        font-size: 40px;
    }
    
    .services-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Remove vertical dividers between cards on 2-column layout */
    .service-card-wrapper:nth-child(2n)::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .allo-services-widget {
        padding: 60px 0;
        overflow: visible;
    }
    
    .services-container {
        min-height: 500px;
        overflow: visible;
    }
    
    /* Hide white divider bars on mobile */
    .services-container::before,
    .services-top-row::after,
    .services-header-column::after {
        display: none;
    }
    
    .header-section,
    .heading-section {
        padding: 5px 20px;
    }
    
    .services-heading {
        font-size: 32px;
    }
    
    .services-top-text {
        font-size: 16px;
    }
    
    .services-cards-row {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    
    /* Remove all vertical dividers on mobile */
    .service-card-wrapper::after {
        display: none;
    }
    
    .service-card-wrapper {
        padding: 10px;
        position: relative;
        z-index: 1;
    }
    
    .service-card-wrapper:hover,
    .service-card-wrapper:active {
        z-index: 100;
    }
    
    .service-card {
        padding: 25px 20px;
        min-height: auto;
        transition: all 0.3s ease;
        position: relative;
        overflow: visible;
    }
    
    /* Hide default content on mobile hover to prevent duplicate titles */
    .service-card:hover .card-default-content,
    .service-card:active .card-default-content {
        opacity: 0;
    }
    
    /* Keep hover content absolute on mobile to prevent container expansion */
    .card-hover-content {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        padding: 25px 20px;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        border-radius: 16px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        min-height: 200px;
        height: auto;
    }
    
    .service-card:hover .card-hover-content,
    .service-card:active .card-hover-content {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    .service-card-title {
        font-size: 22px;
    }
    
    .card-hover-content .service-card-title {
        font-size: 20px;
    }
    
    .service-description {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .services-heading {
        font-size: 26px;
    }
    
    .service-card {
        padding: 20px 15px;
    }
    
    .service-card-title {
        font-size: 20px;
    }
}
