/* Services Menu Layout Fixes */

/* Main container */
.clean-services-menu {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 1rem;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(142, 125, 115, 1);
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: #666;
}

/* Accordion styling */
.modern-accordion {
    width: 100%;
}

/* Services grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
}

/* Service card - KEEP OVERFLOW HIDDEN FOR COLLAPSE */
.modern-service-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden; /* Must be hidden for proper collapse */
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.modern-service-card:hover {
    box-shadow: 0 8px 24px rgba(142, 125, 115, 0.2);
    transform: translateY(-4px);
    border-color: rgba(142, 125, 115, 0.15);
}

.service-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Service header - FIXED BORDER SPACING */
.clean-service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    margin: 0.5rem;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(142, 125, 115, 0.05), rgba(142, 125, 115, 0.1));
    transition: background 0.3s ease;
    border-radius: 12px;
    gap: 1rem;
}

.clean-service-header:hover {
    background: linear-gradient(135deg, rgba(142, 125, 115, 0.1), rgba(142, 125, 115, 0.15));
}

.service-header-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
    padding-right: 0.5rem;
}

.service-image-container {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: white;
    border: 2px solid rgba(142, 125, 115, 0.2);
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clean-service-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    padding: 0.25rem 0;
}

/* Expand arrow - IMPROVED SPACING */
.modern-expand-arrow {
    transition: transform 0.3s ease;
    color: rgba(142, 125, 115, 1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 0.25rem;
}

.modern-expand-arrow.expanded {
    transform: rotate(180deg);
}

/* Details container - WITH PROPER COLLAPSE */
.clean-details-container {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, opacity 0.4s ease;
}

.clean-details-container.expanded {
    opacity: 1;
    /* max-height will be set by JavaScript dynamically */
    /* overflow stays hidden for proper collapse */
}

/* Content wrapper - WITH EXTRA BOTTOM PADDING */
.details-content-wrapper {
    padding: 0 2rem 2.5rem 2rem; /* Increased bottom padding to ensure button is visible */
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Description - allows unlimited height expansion */
.clean-description {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

/* Service details container - always below description */
.clean-service-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(142, 125, 115, 0.05);
    border-radius: 12px;
}

/* Detail items */
.clean-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    gap: 1rem;
}

.clean-detail-label {
    font-weight: 600;
    color: #555;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.clean-detail-value {
    font-weight: 700;
    color: rgba(142, 125, 115, 1);
    font-size: 1rem;
    text-align: right;
    word-wrap: break-word;
}

/* Book button container */
.modern-book-container {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Loading container */
.modern-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 3rem;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .clean-services-menu {
        padding: 1rem 0.5rem;
    }

    .page-header {
        margin-bottom: 2rem;
        padding: 1.5rem 0.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.5rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .page-subtitle {
        font-size: 0.95rem;
    }

    .clean-service-header {
        padding: 1.25rem;
        margin: 0.375rem;
        gap: 0.75rem;
    }

    .clean-service-title {
        font-size: 0.95rem;
        line-height: 1.3;
    }

    .service-image-container {
        width: 50px;
        height: 50px;
    }

    .service-header-left {
        gap: 1rem;
        padding-right: 0.25rem;
    }

    .modern-expand-arrow {
        min-width: 28px;
        min-height: 28px;
    }

    .clean-details-container.expanded {
        max-height: 15000px; /* Even larger for mobile where text takes more space */
    }

    .details-content-wrapper {
        padding: 0 1.25rem 2rem 1.25rem; /* Increased bottom padding for mobile */
    }

    /* Better text sizing for mobile */
    .clean-description {
        font-size: 0.875rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }

    .clean-service-details {
        padding: 0.875rem;
        margin-bottom: 1rem;
        gap: 0.5rem;
    }

    .clean-detail-item {
        padding: 0.375rem 0;
    }

    .clean-detail-label {
        font-size: 0.85rem;
    }

    .clean-detail-value {
        font-size: 0.95rem;
    }

    .modern-book-container {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .clean-service-header {
        padding: 1.35rem;
        margin: 0.4rem;
    }

    .clean-details-container.expanded {
        max-height: 12000px;
    }

    .details-content-wrapper {
        padding: 0 1.75rem 2.25rem 1.75rem; /* Increased bottom padding */
    }
}

/* Desktop */
@media (min-width: 1025px) {
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .clean-details-container.expanded {
        max-height: 10000px;
    }
}
