/**
 * MouvSpa Clients Map - Styles
 * New layout: Full-width map + Client card below
 */

:root {
    --mscm-orange: #F37D45;
    --mscm-blue: #48B6E6;
    --mscm-darkblue: #2A3448;
    --mscm-red: #F03B36;
    --mscm-grey: #f5f7fa;
    --mscm-light-blue: #e8f4fa;
    --mscm-border: #e0e6ed;
    --mscm-shadow: 0 4px 20px rgba(42, 52, 72, 0.1);
    --mscm-shadow-hover: 0 8px 30px rgba(42, 52, 72, 0.15);
    --mscm-radius: 12px;
    --mscm-radius-sm: 8px;
    --mscm-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   WRAPPER
   ======================================== */
.mscm-wrapper {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

/* ========================================
   FILTERS BAR
   ======================================== */
.mscm-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--mscm-darkblue) 0%, #1a2433 100%);
    border-radius: var(--mscm-radius) var(--mscm-radius) 0 0;
    flex-wrap: wrap;
}

.mscm-filters-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-family: 'Dosis', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.mscm-filters-label svg {
    opacity: 0.8;
}

.mscm-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex: 1;
}

.mscm-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--mscm-transition);
    backdrop-filter: blur(4px);
}

.mscm-filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.mscm-filter-btn.active {
    background: var(--mscm-orange);
    border-color: var(--mscm-orange);
    color: #fff;
    box-shadow: 0 4px 15px rgba(243, 125, 69, 0.4);
}

.mscm-filter-btn img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.mscm-filters-count {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    white-space: nowrap;
}

.mscm-count-number {
    font-family: 'Dosis', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mscm-orange);
}

.mscm-count-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   MAP SECTION
   ======================================== */
.mscm-map-section {
    border-radius: 0 0 var(--mscm-radius) var(--mscm-radius);
    overflow: hidden;
    box-shadow: var(--mscm-shadow);
    margin-bottom: 2rem;
}

.mscm-filters+.mscm-map-section {
    border-radius: 0;
}

.mscm-map-container {
    position: relative;
    width: 100%;
}

#mscm-map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.mscm-map-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.95);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.mscm-map-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.mscm-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--mscm-grey);
    border-top-color: var(--mscm-orange);
    border-radius: 50%;
    animation: mscm-spin 0.8s linear infinite;
}

@keyframes mscm-spin {
    to {
        transform: rotate(360deg);
    }
}

.mscm-map-loader span {
    color: var(--mscm-darkblue);
    font-size: 0.95rem;
}

/* ========================================
   POPUP STYLES
   ======================================== */
.mscm-popup-wrapper .leaflet-popup-content-wrapper {
    border-radius: var(--mscm-radius-sm);
    box-shadow: var(--mscm-shadow);
    padding: 0;
}

.mscm-popup-wrapper .leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.mscm-popup {
    padding: 1rem 1.25rem;
    text-align: left;
}

.mscm-popup-title {
    font-family: 'Dosis', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #2972C3;
    margin: 0 0 0.5rem 0;
    cursor: pointer;
    transition: var(--mscm-transition);
}

.mscm-popup-title:hover {
    color: var(--mscm-orange);
}

.mscm-popup-address {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #6b7685;
    margin-bottom: 0.75rem;
}

.mscm-popup-address svg {
    flex-shrink: 0;
    color: var(--mscm-orange);
    margin-top: 2px;
}

.mscm-popup-btn {
    display: block;
    margin-left: auto;
    padding: 0.5rem 1.25rem;
    background: var(--mscm-orange);
    color: #fff;
    font-family: 'Dosis', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--mscm-transition);
    text-align: center;
    width: fit-content;
}

.mscm-popup-btn:hover {
    background: #2972C3;
    transform: translateY(-1px);
}

/* ========================================
   CLIENT SECTION (Below Map)
   ======================================== */
.mscm-client-section {
    margin-top: 2rem;
    margin-bottom: 3rem;
    animation: mscm-fadeIn 0.4s ease;
}

@keyframes mscm-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mscm-client-card {
    background: rgba(41, 114, 195, 0.05);
    border-radius: var(--mscm-radius);
    padding: 2rem;
    box-shadow: var(--mscm-shadow);
}

.mscm-card-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

.mscm-card-error {
    text-align: center;
    padding: 3rem;
    color: #666;
}

/* Main Card Layout */
.mscm-card-main {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Left Column: Info */
.mscm-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mscm-card-title {
    font-family: 'Dosis', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #2972C3;
    margin: 0 0 0.5rem 0;
}

.mscm-card-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #4a5568;
    font-size: 0.95rem;
}

.mscm-card-detail svg {
    flex-shrink: 0;
    color: var(--mscm-orange);
}

.mscm-card-detail a,
.mscm-card-detail a:link,
.mscm-card-detail a:visited,
.mscm-card-detail a[href^="tel:"] {
    color: #4a5568;
    text-decoration: none;
    font-weight: normal;
}

.mscm-card-detail a:hover,
.mscm-card-detail a[href^="tel:"]:hover {
    color: var(--mscm-orange);
}

/* Attention Box */
.mscm-card-attention {
    margin-top: 1rem;
    padding: 1.25rem;
    background: transparent;
    border: 2px solid var(--mscm-orange);
    border-radius: var(--mscm-radius-sm);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.mscm-attention-header {
    font-family: 'Dosis', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--mscm-orange);
    margin-bottom: 0.5rem;
}

.mscm-card-attention p {
    margin: 0 0 1rem 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
    width: 100%;
}

.mscm-btn-visit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--mscm-orange);
    color: #fff;
    font-family: 'Dosis', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 50px;
    transition: var(--mscm-transition);
    margin-left: auto;
}

.mscm-btn-visit:hover {
    background: #2972C3;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(41, 114, 195, 0.4);
}

/* Right Column: Product */
.mscm-card-product {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background-color: #E7EFF8;
    border-radius: var(--mscm-radius);
    padding: 1.5rem;
    background-image: url('../images/product-bg.jpg');
    background-size: 100% auto;
    background-position: top center;
    background-repeat: no-repeat;
    position: relative;
    min-height: 350px;
}

.mscm-product-display {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin-top: 2rem;
}

.mscm-product-image {
    width: 100%;
    height: auto;
    border-radius: var(--mscm-radius);
    object-fit: cover;
    filter: drop-shadow(0 0 34px rgba(41, 114, 195, 0.75));
}

.mscm-product-label {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    padding: 0;
    font-family: 'Dosis', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #2972C3;
}

.mscm-product-label svg {
    width: 20px;
    height: 24px;
    flex-shrink: 0;
}

.mscm-product-label a,
.mscm-product-label a:link,
.mscm-product-label a:visited {
    color: #2972C3 !important;
    text-decoration: none !important;
    transition: var(--mscm-transition);
}

.mscm-product-label a:hover {
    color: var(--mscm-orange) !important;
}

.mscm-product-nav {
    position: absolute;
    bottom: -0.5rem;
    left: -3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.4rem 0.75rem;
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.mscm-product-nav-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--mscm-transition);
    color: #2972C3;
}

.mscm-product-nav-btn:hover {
    background: rgba(41, 114, 195, 0.1);
    color: var(--mscm-orange);
}

.mscm-product-counter {
    font-family: 'Dosis', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2972C3;
    min-width: 30px;
    text-align: center;
}

/* Product image animation */
.mscm-product-image {
    animation: mscm-fadeInProduct 0.4s ease;
}

/* Product label animation */
.mscm-product-label {
    animation: mscm-slideInLabel 0.5s ease;
}

@keyframes mscm-fadeInProduct {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes mscm-slideInLabel {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   GALLERY CAROUSEL
   ======================================== */
.mscm-card-gallery {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mscm-gallery-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    padding: 0.5rem 0;
}

.mscm-gallery-track::-webkit-scrollbar {
    display: none;
}

.mscm-gallery-slide {
    flex: 0 0 auto;
    width: 280px;
    height: 200px;
    border-radius: var(--mscm-radius-sm);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: var(--mscm-transition);
}

.mscm-gallery-slide:hover {
    transform: scale(1.02);
    box-shadow: var(--mscm-shadow-hover);
}

.mscm-gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mscm-gallery-nav {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--mscm-shadow);
    transition: var(--mscm-transition);
    color: var(--mscm-orange);
}

.mscm-gallery-nav:hover {
    background: var(--mscm-orange);
    color: #fff;
}

/* ========================================
   LEAFLET CUSTOMIZATIONS
   ======================================== */
.mscm-marker {
    background: var(--mscm-orange);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 3px 10px rgba(243, 125, 69, 0.4);
    border: 3px solid #fff;
    transition: all 0.2s ease;
}

.mscm-marker-inner {
    transform: rotate(45deg);
    color: #fff;
    font-size: 14px;
}

.mscm-marker:hover,
.mscm-marker.active {
    transform: rotate(-45deg) scale(1.15);
    box-shadow: 0 5px 15px rgba(243, 125, 69, 0.5);
}

.mscm-marker.active {
    background: var(--mscm-red);
}

/* Zoom buttons */
.leaflet-bar {
    box-shadow: var(--mscm-shadow);
    border: none !important;
    border-radius: var(--mscm-radius-sm) !important;
    overflow: hidden;
}

.leaflet-bar a {
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    background-color: #fff !important;
    border-bottom: 1px solid #eee !important;
    color: var(--mscm-darkblue) !important;
    transition: var(--mscm-transition);
    border-radius: 0 !important;
}

.leaflet-bar a:hover {
    background-color: var(--mscm-orange) !important;
    color: #fff !important;
}

/* Cluster markers */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background-color: rgba(243, 125, 69, 0.2);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background-color: var(--mscm-orange);
    color: #fff;
    font-family: 'Dosis', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
}

.marker-cluster div {
    width: 34px;
    height: 34px;
    margin-left: 3px;
    margin-top: 3px;
    text-align: center;
    border-radius: 50%;
    line-height: 34px;
}

/* ========================================
   LIGHTBOX
   ======================================== */
.mscm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mscm-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.mscm-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
}

.mscm-lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--mscm-radius);
    transition: opacity 0.2s ease;
}

.mscm-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mscm-lightbox-close:hover {
    background: var(--mscm-red);
    transform: rotate(90deg);
}

.mscm-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.mscm-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.mscm-lightbox-prev {
    left: 1.5rem;
}

.mscm-lightbox-next {
    right: 1.5rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 992px) {
    .mscm-card-main {
        grid-template-columns: 1fr;
    }

    .mscm-card-product {
        order: -1;
    }

    .mscm-product-display {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .mscm-filters {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .mscm-filters-label {
        width: 100%;
        font-size: 0.9rem;
    }

    .mscm-filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .mscm-client-card {
        padding: 1.5rem;
    }

    .mscm-card-title {
        font-size: 1.5rem;
    }

    .mscm-gallery-slide {
        width: 220px;
        height: 160px;
    }
}

@media (max-width: 480px) {
    .mscm-filters-count {
        width: 100%;
        justify-content: center;
    }

    .mscm-client-card {
        padding: 1rem;
    }

    .mscm-gallery-slide {
        width: 180px;
        height: 130px;
    }
}