/* ============================================================
   Services Section – isolated styles (svc-* prefix)
   ============================================================ */

/* Service Card */
.svc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
    isolation: isolate;
}

.svc-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(24, 34, 48, 0.12);
    border-color: rgba(180, 83, 9, 0.2);
}

.svc-media-wrap {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f3f4f6;
}

.svc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

.svc-card:hover .svc-img {
    transform: scale(1.05);
}

.svc-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f6;
    color: #9ca3af;
    font-size: 13px;
    font-weight: 600;
}

.svc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(17, 24, 39, 0.7), transparent 45%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-end;
    padding: 20px;
    box-sizing: border-box;
    z-index: 2;
}

.svc-card:hover .svc-overlay {
    opacity: 1;
}

.svc-overlay-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
    background: rgba(180, 83, 9, 0.92);
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(180, 83, 9, 0.4);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.45);
    letter-spacing: 0.05em;
}

.svc-arrow {
    width: 16px;
    height: 16px;
}

.svc-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.svc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.svc-title {
    font-size: 15px;
    font-weight: 800;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.svc-status {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.svc-status-available {
    color: #15803d;
    background: #ecfdf5;
    border: 1px solid rgba(21, 128, 61, 0.2);
}

.svc-status-unavailable {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.svc-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 4px;
}

.svc-price-new {
    font-size: 16px;
    font-weight: 800;
    color: #b45309;
}

.svc-price-negotiable {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    font-style: italic;
}

.svc-btn-detail {
    margin-top: auto;
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: #b45309;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.svc-btn-detail:hover {
    background: #934006;
}

.svc-btn-detail:active {
    transform: scale(0.97);
}

/* Before/After Card */
.svc-before-after-wrap {
    margin-bottom: 24px;
}

.svc-ba-media {
    position: relative;
    width: 100%;
    height: 320px;
    background: #eef1f6;
    overflow: hidden;
    border-radius: 12px;
}

.svc-ba-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.svc-ba-pane {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.svc-ba-before {
    clip-path: polygon(0 0, 50% 0, 50% 100%, 0 100%);
    z-index: 2;
}

.svc-ba-after {
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
    z-index: 1;
}

.svc-ba-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.svc-ba-label {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.7);
    padding: 4px 10px;
    border-radius: 6px;
}

.svc-ba-divider {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.5);
    z-index: 3;
    transform: translateX(-50%);
}

.svc-ba-handle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: 50%;
    z-index: 5;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svc-ba-handle svg {
    width: 20px;
    height: 20px;
    color: #b45309;
}

.svc-ba-body {
    padding: 16px;
}

.svc-card-beforeafter .svc-media-wrap {
    height: 0;
    overflow: visible;
}

/* Service Popup / Modal */
.svc-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.35s ease, display 0.35s ease;
    padding: 24px;
    box-sizing: border-box;
    overflow-y: auto;
    direction: rtl;
}

.svc-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.svc-popup-container {
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.svc-popup-overlay.active .svc-popup-container {
    opacity: 1;
    transform: scale(1);
}

.svc-popup-close {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease;
}

.svc-popup-close:hover {
    background: #ffffff;
}

.svc-popup-close svg {
    width: 20px;
    height: 20px;
}

.svc-popup-content {
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.svc-popup-media {
    width: 100%;
    height: 320px;
    background: #f3f4f6;
    position: relative;
    overflow: hidden;
}

.svc-popup-img-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svc-popup-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.svc-popup-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f6;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 600;
}

.svc-popup-details {
    padding: 28px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.svc-popup-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.svc-popup-title {
    font-size: 24px;
    font-weight: 900;
    color: #111827;
    margin: 0;
    line-height: 1.2;
}

.svc-popup-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.svc-popup-tag {
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.svc-popup-tag-available {
    color: #15803d;
    background: #ecfdf5;
    border: 1px solid rgba(21, 128, 61, 0.2);
}

.svc-popup-tag-unavailable {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.svc-popup-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 4px;
}

.svc-popup-price-new {
    font-size: 22px;
    font-weight: 900;
    color: #b45309;
}

.svc-popup-price-negotiable {
    font-size: 16px;
    font-weight: 700;
    color: #6b7280;
    font-style: italic;
}

.svc-popup-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.svc-popup-btn-primary,
.svc-popup-btn-outline {
    flex: 1;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
}

.svc-popup-btn-primary {
    background: #b45309;
    color: #ffffff;
}

.svc-popup-btn-primary:hover {
    background: #934006;
}

.svc-popup-btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: #111827;
}

.svc-popup-btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Services Page Layout */
.svc-page-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 28px;
    box-sizing: border-box;
}

.svc-page-header {
    text-align: center;
    margin-bottom: 48px;
}

.svc-page-title {
    font-size: 32px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.svc-page-title::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b45309;
    box-shadow: 0 0 14px #b45309;
}

.svc-page-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.svc-page-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 16px;
}

.svc-page-empty {
    text-align: center;
    color: var(--muted);
    padding: 60px 24px;
    font-size: 16px;
}

@media (max-width: 1024px) {
    .svc-page-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .svc-page-container {
        width: 100%;
        max-width: none;
        padding: 0;
    }
    .svc-page-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .svc-page-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .svc-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .svc-page-grid > .card {
        min-width: 0;
        height: auto !important;
        overflow: hidden;
        border-radius: 14px;
    }

    .svc-page-grid .card-media {
        height: 100px !important;
    }

    .svc-page-grid .card-body {
        gap: 5px;
        padding: 8px !important;
    }

    .svc-page-grid .card-title {
        overflow: hidden;
        font-size: 0.82rem !important;
        text-overflow: ellipsis;
        white-space: nowrap !important;
    }

    .svc-page-grid > .svc-before-after-wrap {
        min-width: 0;
        margin-bottom: 0;
    }

    .svc-page-grid .svc-media-wrap {
        height: 100px !important;
    }

    .svc-page-grid .svc-card-beforeafter .svc-media-wrap {
        height: 150px !important;
        overflow: hidden;
    }

    .svc-page-grid .svc-body {
        gap: 6px;
        padding: 10px;
    }

    .svc-page-grid .svc-ba-body {
        padding: 10px;
    }

    .svc-page-grid .svc-title {
        font-size: 0.82rem;
    }

    .svc-page-grid .svc-btn-detail {
        padding: 9px 8px;
        font-size: 0.75rem;
    }
}

[dir="rtl"] .svc-popup-close {
    left: auto;
    right: 16px;
}
