
.mhm-section-smart {
    padding-top: var(--mhm-space-3xl);
    padding-right: var(--mhm-space-md);
    padding-bottom: var(--mhm-space-3xl);
    padding-left: var(--mhm-space-md);
    border-radius: var(--mhm-radius-lg, 20px);
   box-shadow: 0 15px 24px rgba(0, 0, 0, 0.2);
   background: var(--mhm-card-1, #D6CFC5); /* Placeholder colour while loading */
   }

/**
 * CMS (Curtain Making Services) - Custom Styles
 * ============================================================================
 * Site-specific components for Curtain Making Services website.
 * These extend the MHM Brand Kit base styles.
 *
 * Sections:
 * 1. Scrolling Gallery (Auto-scroll showcase)
 * 2. Filterable Gallery Grid (Category filtering)
 * 3. Lightbox/Modal (Full-screen image viewer)
 * 4. Fabric Swatches (Material displays)
 * 5. Before/After Comparison (Transformation showcase)
 * 6. Measurement Guide (Window sizing helper)
 * 7. Consultation Booking (CTA sections)
 * 8. Curtain-Specific Utilities
 * ============================================================================
 */

/* ==========================================================================
   1. SCROLLING GALLERY (Auto-scroll Showcase)
   ========================================================================== */

.cms-gallery-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Fade edges for seamless infinite scroll */
.cms-gallery-wrapper::before,
.cms-gallery-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100px;
    z-index: 2;
    pointer-events: none;
}

.cms-gallery-wrapper::before {
    left: 0;
    padding: 20px 0;
    background: linear-gradient(to right, var(--mhm-card-bg, #FAF8F5), transparent);
}

.cms-gallery-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--mhm-card-bg, #FAF8F5), transparent);
}

.cms-gallery-track {
    display: flex;
    gap: 24px;
    padding: 20px 0;
    animation: cmsScroll 40s linear infinite;
    width: max-content;
}

/* Pause animation on hover */
.cms-gallery-track:hover {
    animation-play-state: paused;
}

.cms-gallery-item {
    flex-shrink: 0;
    width: 350px;
    height: 450px;
    border-radius: var(--mhm-radius-lg, 20px);
    overflow: hidden;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cms-gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.55);
}

.cms-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cms-gallery-item:hover img {
    transform: scale(1.05);
}

@keyframes cmsScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-350px * 6 - 24px * 6));
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cms-gallery-item {
        width: 280px;
        height: 360px;
    }

    @keyframes cmsScroll {
        0% {
            transform: translateX(0);
        }
        100% {
            transform: translateX(calc(-280px * 6 - 24px * 6));
        }
    }

    .cms-gallery-wrapper::before,
    .cms-gallery-wrapper::after {
        width: 50px;
    }
}

/* ==========================================================================
   2. FILTERABLE GALLERY GRID
   ========================================================================== */

/* Filter Buttons */
.cms-filter-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: var(--mhm-space-xl, 48px);
}

.cms-filter-btn {
    padding: 10px 24px;
    border: 1px solid var(--mhm-border, #D6CFC5);
    border-radius: 50px;
    background: transparent;
    color: var(--mhm-primary, #C4856A);
    font-family: var(--mhm-body-font, 'DM Sans', system-ui, sans-serif);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cms-filter-btn:hover {
    border-color: var(--mhm-accent, #C4856A);
    background: rgba(196, 133, 106, 0.08);
}

.cms-filter-btn.active {
    background: var(--mhm-primary, #4A5859);
    border-color: var(--mhm-primary, #4A5859);
    color: white;
}

/* Gallery Grid Layout */
.cms-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

@media (max-width: 992px) {
    .cms-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 576px) {
    .cms-gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Gallery Cards */
.cms-gallery-card {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.cms-gallery-card.hidden {
    display: none;
}

/* Fade-in animation for filtered items */
.cms-gallery-card.fade-in {
    animation: cmsFadeInUp 0.4s ease forwards;
}

@keyframes cmsFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gallery Image Container */
.cms-gallery-image {
    aspect-ratio: 1 / 1;
    border-radius: var(--mhm-radius-lg, 16px);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    background: var(--mhm-border, #D6CFC5); /* Placeholder while loading */
}

.cms-gallery-image:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.15);
}

.cms-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, opacity 0.3s ease;
    opacity: 0;
}

/* Fade in when image loads */
.cms-gallery-image img.loaded {
    opacity: 1;
}

.cms-gallery-image:hover img {
    transform: scale(1.06);
}

/* Zoom icon overlay */
.cms-gallery-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 55, 72, 0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3Cline x1='11' y1='8' x2='11' y2='14'%3E%3C/line%3E%3Cline x1='8' y1='11' x2='14' y2='11'%3E%3C/line%3E%3C/svg%3E") center center no-repeat;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.cms-gallery-image:hover::after {
    background-color: rgba(45, 55, 72, 0.3);
    opacity: 1;
}

.cms-gallery-caption {
    margin-top: 14px;
    font-size: 0.9rem;
    color: var(--mhm-muted, #6B7280);
    padding-left: 0px;
    text-align: center;
}

/* ==========================================================================
   3. LIGHTBOX/MODAL (Full-screen Image Viewer)
   ========================================================================== */

.cms-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cms-lightbox.active {
    display: flex;
    opacity: 1;
}

.cms-lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 90vh;
}

.cms-lightbox-close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 45px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    line-height: 1;
    padding: 10px;
    z-index: 10;
}

.cms-lightbox-close:hover {
    color: var(--mhm-accent, #C4856A);
    transform: scale(1.1);
}

.cms-lightbox-prev,
.cms-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 32px;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    padding: 20px 16px;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.cms-lightbox-prev {
    left: 20px;
}

.cms-lightbox-next {
    right: 20px;
}

.cms-lightbox-prev:hover,
.cms-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--mhm-accent, #C4856A);
}

#cms-lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--mhm-radius, 12px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#cms-lightbox-img.loaded {
    opacity: 1;
    transform: scale(1);
}

#cms-lightbox-caption {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 20px;
    font-size: 1rem;
    text-align: center;
    font-family: var(--mhm-body-font, 'DM Sans', system-ui, sans-serif);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .cms-lightbox-prev,
    .cms-lightbox-next {
        padding: 15px 12px;
        font-size: 24px;
    }

    .cms-lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 36px;
    }
}

/* ==========================================================================
   4. FABRIC SWATCHES (Material Displays)
   ========================================================================== */

.cms-fabric-swatches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--mhm-space-lg, 24px);
}

.cms-fabric-swatch {
    display: flex;
    flex-direction: column;
    gap: var(--mhm-space-sm, 8px);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.cms-fabric-swatch:hover {
    transform: translateY(-4px);
}

.cms-fabric-swatch__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--mhm-radius, 12px);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

.cms-fabric-swatch__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.cms-fabric-swatch:hover .cms-fabric-swatch__image img {
    transform: scale(1.1);
}

/* Texture overlay effect */
.cms-fabric-swatch__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(255, 255, 255, 0.03) 2px,
            rgba(255, 255, 255, 0.03) 4px
    );
    pointer-events: none;
}

.cms-fabric-swatch__name {
    font-weight: 600;
    color: var(--mhm-text, #222222);
    font-size: 0.9375rem;
}

.cms-fabric-swatch__details {
    font-size: 0.8125rem;
    color: var(--mhm-muted, #6B7280);
}

.cms-fabric-swatch__badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--mhm-secondary, #C0D5C5);
    border-radius: var(--mhm-radius-sm, 6px);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

/* ==========================================================================
   5. BEFORE/AFTER COMPARISON (Transformation Showcase)
   ========================================================================== */

.cms-before-after {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--mhm-radius-lg, 20px);
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.cms-before-after__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cms-before-after__after {
    clip-path: inset(0 50% 0 0);
    transition: clip-path 0.3s ease;
}

.cms-before-after__slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: white;
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 10;
}

.cms-before-after__slider::after {
    content: '⟷';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--mhm-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cms-before-after__label {
    position: absolute;
    bottom: 20px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: var(--mhm-radius-sm, 6px);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 5;
}

.cms-before-after__label--before {
    left: 20px;
}

.cms-before-after__label--after {
    right: 20px;
}

/* ==========================================================================
   6. MEASUREMENT GUIDE (Window Sizing Helper)
   ========================================================================== */

.cms-measurement-guide {
    background: var(--mhm-card-bg, #ffffff);
    border-radius: var(--mhm-radius-lg, 20px);
    padding: var(--mhm-space-xl, 32px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.cms-measurement-guide__title {
    font-family: var(--mhm-heading-font, Georgia, serif);
    font-size: 1.5rem;
    color: var(--mhm-primary);
    margin-bottom: var(--mhm-space-md, 16px);
}

.cms-measurement-diagram {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--mhm-space-xl, 32px);
    margin-bottom: var(--mhm-space-lg, 24px);
}

.cms-measurement-visual {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--mhm-bg, #F7F5F2);
    border-radius: var(--mhm-radius, 12px);
    border: 2px dashed var(--mhm-border, #E5E7EB);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cms-measurement-visual__label {
    position: absolute;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mhm-primary);
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cms-measurement-visual__label--width {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.cms-measurement-visual__label--height {
    right: 10px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.cms-measurement-steps {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cms-measurement-steps li {
    padding-left: 2rem;
    position: relative;
    margin-bottom: var(--mhm-space-sm, 8px);
    line-height: 1.6;
}

.cms-measurement-steps li::before {
    content: counter(step);
    counter-increment: step;
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--mhm-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.cms-measurement-steps {
    counter-reset: step;
}

/* ==========================================================================
   7. CONSULTATION BOOKING (CTA Sections)
   ========================================================================== */

.cms-consultation-cta {
    background: linear-gradient(135deg, var(--mhm-primary) 0%, var(--mhm-accent) 100%);
    border-radius: var(--mhm-radius-lg, 20px);
    padding: var(--mhm-space-2xl, 48px);
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

/* Subtle fabric texture overlay */
.cms-consultation-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
            90deg,
            transparent,
            transparent 3px,
            rgba(255, 255, 255, 0.02) 3px,
            rgba(255, 255, 255, 0.02) 6px
    );
    pointer-events: none;
}

.cms-consultation-cta__content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.cms-consultation-cta__title {
    font-family: var(--mhm-heading-font, Georgia, serif);
    font-size: 2rem;
    margin-bottom: var(--mhm-space-md, 16px);
    color: white;
}

.cms-consultation-cta__text {
    font-size: 1.125rem;
    margin-bottom: var(--mhm-space-lg, 24px);
    opacity: 0.95;
}

.cms-consultation-cta__button {
    display: inline-flex;
    align-items: center;
    gap: var(--mhm-space-sm, 8px);
    padding: var(--mhm-space-md, 16px) var(--mhm-space-xl, 32px);
    background: white;
    color: var(--mhm-primary);
    border-radius: var(--mhm-radius-full, 9999px);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.cms-consultation-cta__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   8. CURTAIN-SPECIFIC UTILITIES
   ========================================================================== */

/* Drape/Fold Animation */
@keyframes cmsDrape {
    0%, 100% {
        transform: translateY(0) scaleY(1);
    }
    50% {
        transform: translateY(-5px) scaleY(0.98);
    }
}

.cms-drape-animation {
    animation: cmsDrape 3s ease-in-out infinite;
}

/* Fabric Texture Overlay (can be applied to any element) */
.cms-fabric-texture {
    position: relative;
}

.cms-fabric-texture::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.02) 2px,
            rgba(0, 0, 0, 0.02) 4px
    );
    pointer-events: none;
}

/* Room Type Badges */
.cms-room-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--mhm-secondary, #C0D5C5);
    border-radius: var(--mhm-radius-full, 9999px);
    font-size: 0.8125rem;
    font-weight: 500;
}

.cms-room-badge--living {
    background: rgba(192, 213, 197, 0.3);
    color: #2D5F3E;
}

.cms-room-badge--bedroom {
    background: rgba(169, 139, 95, 0.3);
    color: #5C4A33;
}

.cms-room-badge--office {
    background: rgba(90, 130, 88, 0.3);
    color: #2D5F3E;
}

/* Style Tags (Curtain Styles) */
.cms-style-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--mhm-bg, #F7F5F2);
    border: 1px solid var(--mhm-border, #E5E7EB);
    border-radius: var(--mhm-radius-sm, 6px);
    font-size: 0.75rem;
    color: var(--mhm-muted, #6B7280);
    margin: 2px;
}

.cms-style-tag--modern {
    border-color: var(--mhm-primary);
    color: var(--mhm-primary);
}

.cms-style-tag--classic {
    border-color: var(--mhm-accent);
    color: var(--mhm-accent);
}

/* Process Steps (for How It Works sections) */
.cms-process-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--mhm-space-xl, 32px);
    margin-top: var(--mhm-space-2xl, 48px);
}

.cms-process-step {
    text-align: center;
    position: relative;
}

.cms-process-step__number {
    width: 60px;
    height: 60px;
    margin: 0 auto var(--mhm-space-md, 16px);
    background: var(--mhm-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--mhm-heading-font, Georgia, serif);
}

.cms-process-step__title {
    font-weight: 600;
    margin-bottom: var(--mhm-space-sm, 8px);
    color: var(--mhm-text);
}

.cms-process-step__text {
    font-size: 0.9375rem;
    color: var(--mhm-muted);
    line-height: 1.6;
}

/* Testimonial Card (Curtain-specific styling) */
.cms-testimonial {
    background: var(--mhm-card-bg, #ffffff);
    padding: var(--mhm-space-xl, 32px);
    border-radius: var(--mhm-radius-lg, 20px);
    border-left: 4px solid var(--mhm-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.cms-testimonial__quote {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--mhm-text);
    line-height: 1.7;
    margin-bottom: var(--mhm-space-md, 16px);
}

.cms-testimonial__quote::before {
    content: '"';
    font-size: 3rem;
    color: var(--mhm-primary);
    opacity: 0.3;
    line-height: 0;
    margin-right: 8px;
}

.cms-testimonial__author {
    display: flex;
    align-items: center;
    gap: var(--mhm-space-md, 16px);
}

.cms-testimonial__author-image {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.cms-testimonial__author-name {
    font-weight: 600;
    color: var(--mhm-text);
}

.cms-testimonial__author-details {
    font-size: 0.875rem;
    color: var(--mhm-muted);
}

.section-divider {
    border: none;
    height: 35px;
    margin: 5rem 0;
    background: transparent;
}

.section-divider-md {
    border: none;
    height: 20px;
    margin: 5rem 0;
    background: transparent;
}

/* Calm Home Service: image should go full width on mobile */

.mhm-img-card{
    border-radius: clamp(30px, 2vw, 60px);
    box-shadow: 0 18px 36px rgba(0,0,0,0.3);
    overflow: hidden;
}
.mhm-img-card-bd{
    border-radius: clamp(30px, 2vw, 60px);
    border: 1px solid #2b2b2b;
    box-shadow: 0 18px 36px rgba(0,0,0,0.3);
    overflow: hidden;
}
.mhm-calm-img{
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.mhm-divider-gradient {
    height: 1px;
    background: linear-gradient(
            to right,
            transparent,
            var(--mhm-border, #E5E7EB),
            transparent
    );
    border: none;
}