/* ═══ Entre Musgo — Grid + Filters + Modal v2.0 ═══ */

/* ═══ Blog: imágenes de artículos sin deformación ═══ */
.post-thumb-img-content img,
.post-thumb img,
.ast-blog-single-element .post-thumb img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ═══ Custom Footer ═══ */

/* Hide Astra default footer */
.site-footer#colophon {
    display: none !important;
}

.em-footer {
    background: #1A3C2B;
    color: #c8ddd0;
    font-size: 0.95rem;
    line-height: 1.7;
}

.em-footer a {
    color: #a8d5ba;
    text-decoration: none;
    transition: color 0.2s;
}

.em-footer a:hover {
    color: #fff;
}

.em-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 2rem 2rem;
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1fr;
    gap: 3rem;
}

.em-footer-heading {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1.2rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Brand column */
.em-footer-logo-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.em-footer-logo-svg {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.em-footer-brand-name {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.em-footer-tagline {
    margin: 0 0 1.2rem;
    color: #9cc4a8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.em-footer-social {
    display: flex;
    gap: 0.8rem;
}

.em-footer-social a {
    color: #9cc4a8;
    transition: color 0.2s, transform 0.2s;
}

.em-footer-social a:hover {
    color: #fff;
    transform: translateY(-2px);
}

/* Nav column */
.em-footer-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.em-footer-nav li {
    margin-bottom: 0.5rem;
}

.em-footer-nav a {
    font-size: 0.95rem;
}

/* Contact column */
.em-footer-contact ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.em-footer-contact li {
    margin-bottom: 0.7rem;
    font-size: 0.9rem;
}

/* Bottom bar */
.em-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    padding: 1.2rem 2rem;
}

.em-footer-bottom p {
    margin: 0;
    font-size: 0.82rem;
    color: #7bab8e;
}

@media (max-width: 768px) {
    .em-footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2.5rem 1.5rem 1.5rem;
        text-align: center;
    }
    .em-footer-logo-link {
        justify-content: center;
    }
    .em-footer-social {
        justify-content: center;
    }
    .em-footer-nav ul,
    .em-footer-contact ul {
        text-align: center;
    }
}

/* Tabs — hidden (unified filter row replaces tabs) */
.em-tabs-nav {
    display: none;
}

.em-tab-btn {
    padding: 0.8rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s;
    margin-bottom: -2px;
}

.em-tab-btn:hover {
    color: #2D6A4F;
}

.em-tab-btn.em-tab-active {
    color: #2D6A4F;
    border-bottom-color: #2D6A4F;
}

.em-tab-content {
    display: none;
}

.em-tab-content.em-tab-active {
    display: block;
}

/* Filters — Hover-expandable in single horizontal row */
.em-filters {
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    flex-wrap: nowrap;
    overflow: visible;
}

.em-filter-group.em-filter-hover {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-shrink: 0;
    padding: 0.4rem 0;
    box-shadow: none !important;
}

/* Active filter display button (visible by default, hidden on hover) */
.em-filter-active-display {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.2rem 0.4rem;
    border: none;
    background: transparent !important;
    color: #2D6A4F !important;
    cursor: pointer;
    transition: max-width 0.35s ease-in-out 0.15s, opacity 0.3s ease-in-out 0.15s, padding 0.35s ease-in-out 0.15s;
    font-size: 1rem;
    font-family: inherit;
    font-weight: bold;
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    box-shadow: none !important;
}

.em-filter-active-display:hover {
    color: #2D6A4F !important;
    font-weight: bold;
    transform: scale(1.05);
    background: transparent !important;
    box-shadow: none !important;
}

/* Map button — always green, wider for "Jardines en X" text */
.em-map-btn {
    color: #2D6A4F !important;
    max-width: 400px;
}

/* Hide active button when hovering the group */
.em-filter-group.em-filter-hover:hover .em-filter-active-display {
    max-width: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
    transition-delay: 0s;
}

.em-filter-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    display: none;
}

.em-filter-icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-filter-icon-wrap:not(:empty) {
    display: block;
}

/* Dropdown (collapsed by default, animates horizontally on hover) */
.em-filter-dropdown {
    display: flex;
    flex-direction: row;
    gap: 0.8rem;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.4s ease-in-out 0.15s, opacity 0.3s ease-in-out 0.15s;
    pointer-events: none;
}

/* Expand dropdown when hovering the entire group */
.em-filter-group.em-filter-hover:hover .em-filter-dropdown {
    max-width: 1200px;
    opacity: 1;
    overflow: visible;
    transition-delay: 0s;
    pointer-events: auto;
}

/* Filter buttons inside dropdown — minimalist style (no boxes, just text + icons) */
.em-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.2rem 0.4rem;
    border: none;
    background: transparent;
    color: #333;
    cursor: pointer;
    transition: color 0.2s;
    font-size: 1rem;
    font-family: inherit;
    font-weight: normal;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: none !important;
}

.em-filter-btn:hover {
    color: #2D6A4F;
    font-weight: bold;
    background: transparent !important;
    box-shadow: none !important;
}

.em-filter-btn:hover span {
    display: inline-block;
    transform: scale(1.08);
    text-shadow: 0 3px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.em-filter-btn:hover .em-filter-icon {
    position: relative;
    z-index: 1000;
    transform: scale(1.5);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.em-filter-btn.em-active {
    color: #2D6A4F;
    font-weight: bold;
}

.em-filter-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    transition: transform 0.2s, filter 0.2s;
}

.em-filter-unavailable {
    display: none !important;
}

/* Full width — override Astra theme container */
.ast-container {
    max-width: 100% !important;
    padding-left: 6rem !important;
    padding-right: 6rem !important;
}

body .em-proyectos-wrap,
body .em-productos-wrap {
    max-width: 100% !important;
    width: 100% !important;
}

/* ═══ Editor CTA on Comprar page ═══ */
.em-editor-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #1A3C2B 0%, #2D6A4F 100%);
    border-radius: 12px;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

.em-editor-cta-text h3 {
    color: #fff;
    font-size: 1.2rem;
    margin: 0 0 0.3rem;
}

.em-editor-cta-text p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin: 0;
}

.em-editor-cta-btn {
    flex-shrink: 0;
    background: #fff !important;
    color: #1A3C2B !important;
    font-weight: 600;
    padding: 0.7rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s, transform 0.2s;
}

.em-editor-cta-btn:hover {
    background: #e8f0ed !important;
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .em-editor-cta {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem;
    }
}

/* ═══ Banner — crossfade image carousel ═══ */
.em-banner {
    position: relative;
    width: 100%;
    height: 340px;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 2rem;
}

/* ═══ Proyectos page chrome cleanup ═══ */
body.em-proyectos-page .entry-header,
body.em-proyectos-page .ast-article-single .entry-header {
    display: none !important;
}

body.em-proyectos-page .em-banner {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    border-radius: 0;
}

body.em-proyectos-page .ast-article-single,
body.em-proyectos-page .site-content > .ast-container,
body.em-proyectos-page .entry-content,
body.em-proyectos-page #primary,
body.em-proyectos-page #content {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.em-proyectos-page .em-proyectos-wrap {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.em-proyectos-page .em-banner {
    margin-top: 0 !important;
}

/* Card video — fill the same box as the img */
.em-card-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.em-banner-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
}

.em-banner-img.em-banner-active {
    opacity: 1;
}

.em-banner-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(31, 71, 52, 0.6);
}

/* Grid — 3 columns, wider and more spaced */
.em-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4rem 5rem;
    max-width: 100%;
}

/* Cards */
.em-card {
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.em-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.em-card-media {
    position: relative;
    overflow: hidden;
}

.em-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.em-card-placeholder {
    background: #ddd;
    aspect-ratio: 4 / 3;
}

/* Hover cycling overlay */
.em-card-cycle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 1;
}

.em-card-cycle.em-visible {
    opacity: 1;
}

.em-card-body {
    padding: 1rem;
}

.em-card-body h3 {
    font-size: 1rem;
    color: #1A3C2B;
    margin: 0 0 0.3rem;
}

.em-card-body p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
}

/* Product cards */
.em-producto-card {
    background: #fff;
    border: 1px solid #e0e0e0;
}

.em-producto-card.em-popular {
    border: 2px solid #2D6A4F;
}

.em-producto-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transform: none;
}

.em-card-img-wrap {
    position: relative;
}

.em-badge {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: #2D6A4F;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.em-product-meta {
    color: #666;
    font-size: 0.85rem;
}

.em-precio {
    font-size: 1.3rem;
    color: #2D6A4F;
    font-weight: bold;
    margin: 0.5rem 0;
}

/* Buttons */
.em-btn {
    display: inline-block;
    padding: 0.75rem 1.8rem;
    background: #2D6A4F;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    transition: background 0.3s;
    text-align: center;
}

.em-btn:hover {
    background: #1A3C2B;
    color: #fff;
}

.em-btn-outline {
    background: transparent;
    border: 2px solid #2D6A4F;
    color: #2D6A4F;
}

.em-btn-outline:hover {
    background: #2D6A4F;
    color: #fff;
}

.em-add-to-cart {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Region Map */
.em-region-map-container {
    max-width: 900px;
    margin: 0 auto 2rem;
    max-height: 1000px;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.4s ease;
}

.em-region-map-container.em-map-collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

.em-map-toggle-btn {
    display: none;
    margin: 0 auto 2rem;
    padding: 0.8rem 2rem;
    background: #2D6A4F;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.em-map-toggle-btn:hover {
    background: #1f4d38;
    transform: translateY(-2px);
}

.em-spain-map {
    width: 100%;
    height: auto;
}

.em-spain-map .region {
    fill: #e8f0ed;
    stroke: #2D6A4F;
    stroke-width: 0.8;
    cursor: pointer;
    transition: fill 0.3s;
}

.em-spain-map .region:hover {
    fill: #c5dfd5;
}

.em-spain-map .region.em-region-active {
    fill: #2D6A4F;
}

.em-spain-map .region-label {
    pointer-events: none;
    user-select: none;
    font-family: inherit;
    font-size: 8px;
    text-anchor: middle;
    fill: #2D6A4F;
    font-weight: 600;
}

.em-spain-map .region.em-region-active ~ .region-label,
.em-spain-map .region-group .region.em-region-active ~ .region-label {
    fill: #fff;
}

.em-spain-map .region-group {
    cursor: pointer;
}

.em-spain-map .region-group:hover .region {
    fill: #c5dfd5;
}

.em-spain-map .region-group .region.em-region-active {
    fill: #2D6A4F;
}

/* Disabled regions (no projects) */
.em-spain-map .region.em-region-disabled {
    fill: #f0f0f0;
    stroke: #ccc;
    cursor: default;
}

.em-spain-map .region.em-region-disabled:hover {
    fill: #f0f0f0;
}

.em-spain-map .em-region-disabled-group {
    cursor: default;
}

.em-spain-map .em-region-disabled-group:hover .region {
    fill: #f0f0f0;
}

.em-spain-map .em-region-disabled-group .region-label {
    fill: #bbb;
}

/* External labels + leader lines */
.em-spain-map .region-label-ext {
    pointer-events: none;
    user-select: none;
    font-family: inherit;
    font-size: 8px;
    text-anchor: middle;
    fill: #2D6A4F;
    font-weight: 600;
}

.em-spain-map .em-leader {
    stroke: #2D6A4F;
    stroke-width: 1.5;
    opacity: 0.8;
}

/* Dim external labels for disabled regions */
.em-spain-map .em-region-disabled-ext {
    fill: #bbb;
}

.em-spain-map .em-leader-disabled {
    stroke: #ccc;
    opacity: 0.3;
}

.em-spain-map .em-leader-dot-disabled {
    fill: #ccc;
    opacity: 0.3;
}

/* ═══ MODAL v2 ═══ */

/* Overlay */
.em-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.em-modal-overlay.em-active {
    display: flex;
}

/* Slide-up animation */
@keyframes emSlideInUp {
    from {
        transform: translateY(100vh);
        opacity: 0;
    }
    to {
        transform: translateY(-50%);
        opacity: 1;
    }
}

.em-modal-overlay.em-active .em-modal {
    animation: emSlideInUp 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modal container — left-anchored, text LEFT image RIGHT */
.em-modal {
    background: #fff;
    border-radius: 12px;
    max-height: 90vh;
    overflow: hidden;
    position: absolute;
    left: 3vw;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: row;
    transition: height 0.35s ease;
}

/* Close button — outside modal, no background, just X */
.em-modal-close {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 3.5rem;
    cursor: pointer;
    color: #fff;
    z-index: 10001;
    line-height: 1;
    padding: 0.5rem;
    opacity: 0.8;
    transition: transform 0.2s, opacity 0.2s;
}

.em-modal-close:hover {
    opacity: 1;
    transform: scale(1.1);
    background: transparent !important;
}

/* Image side — width & height set by JS per image */
.em-modal-img-container {
    flex-shrink: 0;
    position: relative;
    background: #222;
    transition: width 0.35s ease, height 0.35s ease;
}

.em-modal-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
}

/* Next image button — fixed at the image/text divider, golden circle */
.em-modal-nav.em-next {
    position: fixed;
    left: calc(3vw + 380px);
    top: 50%;
    transform: translate(-50%, -50%);
    background: #C5A028;
    border: none;
    font-size: 3.2rem;
    cursor: pointer;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: #fff;
    z-index: 10001;
    padding: 0 0 9px 0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.em-modal-nav.em-next:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Next project button — right side, subtle like close button */
.em-modal-nav.em-next-project {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 5rem;
    cursor: pointer;
    color: #fff;
    z-index: 10001;
    line-height: 1;
    padding: 0.5rem;
    opacity: 0.8;
    transition: transform 0.2s, opacity 0.2s;
}

.em-modal-nav.em-next-project:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Dots indicator */
.em-modal-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
    z-index: 5;
}

.em-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.em-dot.em-dot-active {
    background: #fff;
}

.em-dot:hover {
    background: rgba(255,255,255,0.8);
}

/* Body side — fixed width on left, stretches to image height */
.em-modal-body {
    width: 380px;
    box-sizing: border-box;
    flex-shrink: 0;
    align-self: stretch;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: 12px 0 0 12px;
}

/* Header: title + like */
.em-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.em-modal-title {
    font-size: 1.7rem;
    color: #1A3C2B;
    margin: 0;
    line-height: 1.3;
    font-weight: 900;
}


/* Texto principal */
.em-modal-texto-principal {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.7;
}

.em-modal-texto-principal p {
    margin: 0 0 0.5rem;
}

/* Texto SEO */
.em-modal-texto-seo {
    font-size: 0.82rem;
    color: #999;
    line-height: 1.5;
    margin: 0;
}

/* Meta line: Cliente · Fecha · Lugar · Leer más */
.em-modal-meta-line {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
}

.em-modal-meta-line a {
    color: #2D6A4F;
    text-decoration: none;
    font-weight: 600;
}

.em-modal-meta-line a:hover {
    text-decoration: underline;
}

.em-meta-dot {
    margin: 0 0.3rem;
    color: #ccc;
}

/* Circles: Materiales + Productos — two groups, together if they fit, separate if not */
.em-modal-circles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding-bottom: 0.3rem;
}

.em-circles-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.em-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.em-circle-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: #e8f0ed;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #2D6A4F;
}

.em-circle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-circle-letter {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2D6A4F;
}

.em-circle-name {
    font-size: 0.7rem;
    color: #666;
    text-align: center;
    max-width: 70px;
    word-wrap: break-word;
    line-height: 1.2;
}

.em-circle-product .em-circle-img {
    border-color: #8B6914;
    background: #FFF8E7;
}

.em-circle-product .em-circle-letter {
    color: #8B6914;
}

/* ═══ RESPONSIVE ═══ */

@media (max-width: 768px) {
    .em-banner {
        height: 200px;
    }

    .ast-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .em-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .em-modal {
        flex-direction: column;
        width: 95%;
        max-height: 95vh;
        left: 2.5%;
        height: auto !important;
    }

    .em-modal-img-container {
        width: 100% !important;
        height: auto !important;
        min-height: 250px;
        max-height: 300px;
        order: -1;
    }

    .em-modal-body {
        width: 100%;
        align-self: auto;
        padding: 1.2rem;
        overflow-y: auto;
        border-radius: 0;
    }

    .em-modal-nav.em-next {
        left: auto;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }

    .em-modal-nav.em-next-project {
        display: none;
    }

    .em-modal-title {
        font-size: 1.3rem;
    }

    .em-filter-label {
        min-width: auto;
        width: 100%;
    }

    .em-tabs-nav {
        gap: 0;
    }

    .em-tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .em-region-map-container {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .em-grid {
        grid-template-columns: 1fr;
    }

    .em-card-img {
        aspect-ratio: 4 / 3;
    }

    .em-modal-title {
        font-size: 1.1rem;
    }
}

/* ═══ POPUP MAKER — Two-panel layout ═══ */

/* Overlay oscuro */
.pum-overlay {
    background: rgba(0,0,0,0.75) !important;
}

/* Container — wider for two columns */
.pum-container {
    border-radius: 16px !important;
    max-width: 1040px !important;
    width: 94% !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4) !important;
    overflow: hidden !important;
    top: 3vh !important;
    transform: none !important;
    animation: emPopupSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes emPopupSlideIn {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: none; }
}

/* Close button — circle with X */
.pum-container .pum-close {
    background: rgba(255,255,255,0.15) !important;
    color: transparent !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    padding: 0 !important;
    top: 10px !important;
    right: 10px !important;
    text-indent: -9999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: absolute !important;
    z-index: 10 !important;
}

.pum-container .pum-close::after {
    content: "\00D7" !important;
    color: #fff !important;
    font-size: 1.3rem !important;
    text-indent: 0 !important;
    line-height: 1 !important;
    position: absolute !important;
}

.pum-container .pum-close:hover {
    background: rgba(255,255,255,0.3) !important;
}

/* ═══ TWO-PANEL LAYOUT ═══ */

.em-popup-layout {
    display: flex;
    min-height: 520px;
}

/* Left panel — dark branding */
.em-popup-left {
    width: 300px;
    flex-shrink: 0;
    background: #1A3C2B;
    padding: 1.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    border-radius: 16px 0 0 16px;
}

.em-popup-logo {
    width: 240px;
    height: auto;
    margin-bottom: 0.8rem;
}

.em-popup-tagline {
    color: #ffffff;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 0.3rem;
}

.em-popup-subtitle {
    color: rgba(255,255,255,0.65);
    font-size: 0.95rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.4;
}

/* CTA "Ver proyectos" in popup left panel */
.em-popup-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.em-popup-cta-intro {
    color: rgba(255,255,255,0.7);
    font-size: 0.88rem;
    margin: 0;
}

.em-popup-cta-btn {
    padding: 0.55rem 1.5rem;
    background: #fff;
    color: #1A3C2B;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.2s;
}

.em-popup-cta-btn:hover {
    background: #e8f0ed;
}

.em-popup-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

.em-popup-contact-intro {
    color: rgba(255,255,255,0.55);
    font-size: 0.78rem;
    line-height: 1.4;
    margin: 0;
}

.em-popup-contact-item {
    color: rgba(255,255,255,0.75) !important;
    text-decoration: none !important;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.em-popup-contact-item:hover {
    color: #ffffff !important;
}

.em-popup-contact-item svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    flex-shrink: 0;
}

.em-popup-contact-item svg path[fill] {
    fill: #ffffff !important;
}

/* Right panel — form */
.em-popup-layout .pum-content {
    flex: 1 !important;
    padding: 1rem 2rem 0.4rem !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 88vh !important;
    min-width: 0 !important;
}

/* ═══ CF7 FORM STYLES ═══ */

.pum-content .wpcf7 {
    font-family: inherit;
    min-width: 0;
    max-width: 100%;
}

.pum-content .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    max-width: 100%;
}

/* CF7 wraps every control in <span class="wpcf7-form-control-wrap">.
   That span is inline by default — needs to be a constrained block so
   the materials slider inside can be width:100% and overflow-x within itself
   instead of pushing the form wider. */
.pum-content .wpcf7-form-control-wrap {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Kill ALL default margins inside form */
.pum-content .wpcf7-form label,
.pum-content .wpcf7-form p,
.pum-content .wpcf7-form div {
    margin: 0 !important;
    padding: 0 !important;
}

/* Form rows — grid layout (specificity must beat the reset above) */
.pum-content .wpcf7-form .em-form-row {
    display: grid;
    gap: 0.8rem;
    margin: 0 !important;
    padding: 0.7rem 0 !important;
    min-width: 0;
    max-width: 100%;
}

/* Grid items default to min-width:auto, which makes them grow to content size.
   Force grid children to shrink so overflow-x scroll works on the slider inside. */
.pum-content .wpcf7-form .em-form-row > * {
    min-width: 0;
}

/* First row (materials) — less top spacing */
.pum-content .wpcf7-form .em-form-row:first-child {
    padding-top: 0 !important;
    padding-bottom: 0.4rem !important;
}

/* Last row (submit) — more space above, flush to bottom */
.pum-content .wpcf7-form .em-form-row:last-child {
    padding-top: 0.8rem !important;
    padding-bottom: 0 !important;
}

.em-form-row-2 {
    grid-template-columns: 1fr 1fr;
}

.em-form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Labels inside rows */
.em-form-row > label,
.pum-content .wpcf7-form > label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #1A3C2B;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0 !important;
}

/* Materiales label (plain text, not a <label>) */
.em-form-row .em-mat-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 0.2rem;
}

.em-mat-title {
    color: #1A3C2B;
    font-weight: 600;
}

.em-mat-hint {
    color: #999;
    font-weight: 400;
    text-transform: none;
}

/* Inputs, selects, textareas */
.pum-content .wpcf7-text,
.pum-content .wpcf7-email,
.pum-content .wpcf7-tel,
.pum-content .wpcf7-select,
.pum-content .wpcf7-textarea {
    width: 100% !important;
    padding: 0.55rem 0.8rem !important;
    border: 1.5px solid #d4ddd8 !important;
    border-radius: 8px !important;
    font-size: 0.85rem !important;
    font-family: inherit !important;
    color: #333 !important;
    background: #fafcfb !important;
    transition: border-color 0.3s, box-shadow 0.3s !important;
    box-sizing: border-box !important;
    margin-top: 0.2rem !important;
}

.pum-content .wpcf7-text:focus,
.pum-content .wpcf7-email:focus,
.pum-content .wpcf7-tel:focus,
.pum-content .wpcf7-select:focus,
.pum-content .wpcf7-textarea:focus {
    outline: none !important;
    border-color: #2D6A4F !important;
    box-shadow: 0 0 0 3px rgba(45,106,79,0.1) !important;
    background: #fff !important;
}

.pum-content .wpcf7-textarea,
.pum-content textarea.wpcf7-textarea,
.pum-content .wpcf7-form textarea {
    min-height: 70px !important;
    max-height: 100px !important;
    height: 70px !important;
    resize: vertical !important;
}

.pum-content .wpcf7-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232D6A4F' stroke-width='2' fill='none'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.7rem center !important;
    background-size: 10px 7px !important;
    padding-right: 2rem !important;
    line-height: 1.4 !important;
    height: auto !important;
    min-height: 2.2rem !important;
}

/* File upload */
.pum-content .wpcf7-file {
    padding: 0.4rem !important;
    border: 1.5px dashed #d4ddd8 !important;
    border-radius: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: #fafcfb !important;
    margin-top: 0.2rem !important;
    font-size: 0.82rem !important;
}

/* Materials checkbox row only shown when popup was opened from the editor */
.pum-container:not(.em-popup-from-editor) .pum-content .em-form-row-mat,
.pum-container:not(.em-popup-from-editor) .pum-content .wpcf7-checkbox {
    display: none !important;
}

/* "Diseñar jardín" CTA only shown when popup was NOT opened from the editor
   (no point offering it again if the user just used the editor) */
.pum-container.em-popup-from-editor .em-popup-cta-disenar {
    display: none !important;
}

/* Checkboxes — materiales con iconos (slider horizontal de una fila) */
.pum-content .wpcf7-checkbox {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 0.7rem !important;
    margin-top: 0.3rem !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior-x: contain !important;
    scroll-behavior: smooth !important;
    padding: 4px 2px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    cursor: grab !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 24px), transparent 100%) !important;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 24px), transparent 100%) !important;
}
.pum-content .wpcf7-checkbox::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
.pum-content .wpcf7-checkbox.em-dragging { cursor: grabbing !important; scroll-behavior: auto !important; }

.pum-content .wpcf7-checkbox .wpcf7-list-item {
    margin: 0 !important;
    flex: 0 0 auto !important;
}

.pum-content .wpcf7-checkbox .wpcf7-list-item label {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.2rem !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    font-size: 0.65rem !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    background: transparent !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-weight: 400 !important;
    width: 62px !important;
    text-align: center !important;
}

/* Hide native checkbox */
.pum-content .wpcf7-checkbox input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Material image circle */
.pum-content .wpcf7-checkbox .em-mat-icon {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2.5px solid #d4ddd8 !important;
    transition: border-color 0.25s, box-shadow 0.25s !important;
}

.pum-content .wpcf7-checkbox .wpcf7-list-item label:hover .em-mat-icon {
    border-color: #C5A028 !important;
    box-shadow: 0 0 0 2px rgba(197,160,40,0.2) !important;
}

.pum-content .wpcf7-checkbox input[type="checkbox"]:checked ~ .em-mat-icon {
    border-color: #C5A028 !important;
    box-shadow: 0 0 0 3px rgba(197,160,40,0.3) !important;
}

.pum-content .wpcf7-checkbox .wpcf7-list-item-label {
    font-size: 0.65rem !important;
    color: #666 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    word-wrap: break-word !important;
    min-height: 1.6rem !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

.pum-content .wpcf7-checkbox input[type="checkbox"]:checked + .wpcf7-list-item-label {
    color: #C5A028 !important;
    font-weight: 600 !important;
}

/* Submit button */
.pum-content .wpcf7-submit {
    width: 100% !important;
    padding: 0.7rem 1.5rem !important;
    background: #2D6A4F !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 0.95rem !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.3s, transform 0.2s !important;
    letter-spacing: 0.3px !important;
}

.pum-content .wpcf7-submit:hover {
    background: #1A3C2B !important;
    transform: translateY(-1px) !important;
}

/* ═══ PRODUCT MODAL — specific styles ═══ */

/* Price in modal */
.em-product-price {
    font-size: 1.8rem;
    color: #2D6A4F;
    font-weight: bold;
    margin: 0.5rem 0;
}

.em-product-price del {
    color: #999;
    font-size: 1.2rem;
    font-weight: 400;
}

.em-product-price ins {
    text-decoration: none;
}

/* Description in modal */
.em-product-description {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.6;
}

.em-product-description p {
    margin: 0 0 0.5rem;
}

/* Add to cart button in modal */
.em-product-add-to-cart {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: auto;
}

/* ═══ Product → Materials nested groups in project modal ═══ */
.em-product-materials-group {
    width: 100%;
    margin-bottom: 0.4rem;
}

.em-product-materials-group:last-child {
    margin-bottom: 0;
}

.em-product-group-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8B6914;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
    padding-left: 2px;
}

/* ═══ Product checkboxes in popup form ═══ */
.em-product-checks {
    width: 100%;
}

.em-product-checks-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #8B6914;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.em-product-checks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.em-product-check-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    max-width: 65px;
}

.em-product-cb {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

.em-product-check-name {
    font-size: 0.65rem;
    color: #666;
    line-height: 1.2;
    text-align: center;
    word-wrap: break-word;
    min-height: 1.6rem;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    transition: color 0.2s;
    order: -1;
}

.em-product-check-visual {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid #d4ddd8;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f0e5;
    flex-shrink: 0;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.em-product-check-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.em-product-check-letter {
    font-size: 0.85rem;
    font-weight: 700;
    color: #8B6914;
}

.em-product-check-item:hover .em-product-check-visual {
    border-color: #C5A028;
    box-shadow: 0 0 0 2px rgba(197,160,40,0.2);
}

.em-product-cb:checked + .em-product-check-visual {
    border-color: #C5A028 !important;
    box-shadow: 0 0 0 3px rgba(197,160,40,0.3) !important;
}

.em-product-cb:checked ~ .em-product-check-name {
    color: #C5A028;
    font-weight: 600;
}

/* ═══ "QUIERO ALGO ASÍ" button in gallery modal ═══ */
.em-quiero-asi {
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}

/* Reference block in popup form */
.em-form-referencia {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    background: #f0f7f3;
    border-radius: 8px;
    border: 1.5px solid #d4ddd8;
    margin-bottom: 0.5rem;
    position: relative;
}

.em-form-referencia img {
    width: 70px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.em-form-ref-name {
    font-size: 0.82rem;
    color: #2D6A4F;
    font-weight: 600;
    line-height: 1.3;
}

.em-form-ref-clear {
    position: absolute;
    top: 4px;
    right: 6px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.em-form-ref-clear:hover {
    color: #333;
}

/* Editor design reference */
.em-form-ref-editor {
    overflow: hidden;
}

.em-form-ref-editor .em-form-ref-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}

.em-form-ref-editor img {
    width: 80px;
    height: 60px;
    background: #ffffff;
    object-fit: contain;
}

.em-form-ref-svg {
    width: 80px;
    height: 60px;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.em-form-ref-svg svg {
    width: 100%;
    height: 100%;
    display: block;
}

.em-form-ref-dims {
    font-size: 0.72rem;
    color: #888;
}

.em-form-ref-total {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1A3C2B;
}

.em-form-ref-materials {
    display: flex;
    gap: 0.3rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
    padding: 2px 0;
    margin-top: 2px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    width: 100%;
    max-width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%);
}
.em-form-ref-materials::-webkit-scrollbar { display: none; width: 0; height: 0; }
.em-form-ref-materials.em-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}
.em-form-ref-mat {
    flex: 0 0 auto;
    padding: 2px 8px;
    background: #d4e8dc;
    border-radius: 12px;
    font-size: 0.68rem;
    color: #1A3C2B;
    white-space: nowrap;
    font-weight: 600;
}

/* Popup responsive */
@media (max-width: 768px) {
    .em-popup-layout {
        flex-direction: column;
    }
    .em-popup-left {
        width: 100%;
        border-radius: 16px 16px 0 0;
        padding: 1.2rem 1.5rem;
    }
    .pum-container {
        top: 1vh !important;
    }
}