/* ── Variables ─────────────────────────────────────────────────────────────── */
.qph-map-section {
    --qph-text:         #1f2937;
    --qph-muted:        #6b7280;
    --qph-border:       #f1c9c9;
    --qph-primary:      #cf2e2e;
    --qph-primary-h:    #b02222;
    --qph-shadow:       0 20px 50px rgba(207,46,46,.10);
    font-family: Inter, Arial, sans-serif;
    box-sizing: border-box;
}
.qph-map-section * { box-sizing: border-box; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.qph-map-shell {
    display: grid;
    grid-template-columns: minmax(0,1fr) 380px;
    gap: 20px;
    align-items: start;
}
.qph-card {
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 24px;
    box-shadow: var(--qph-shadow);
}
.qph-map-card {
    padding: 16px;
    overflow: hidden;
    background: #fff;
}
.qph-map-topbar { padding: 6px 6px 14px; }
.qph-map-topbar h3 { margin: 0; font-size: 1.18rem; color: var(--qph-text); }
.qph-map-topbar p  { margin: 5px 0 0; color: var(--qph-muted); font-size: .92rem; }

/* ── Leaflet map container ─────────────────────────────────────────────────── */
.qph-spain-map {
    width: 100%;
    height: 600px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid #f4c6c6;
    background: #fff;
}
.qph-map-section .leaflet-container {
    font-family: Inter, Arial, sans-serif;
    background: #fff;
}
.qph-map-section .leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 16px 35px rgba(207,46,46,.12) !important;
    overflow: hidden;
    border-radius: 16px !important;
}
.qph-map-section .leaflet-control-zoom a {
    width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    border: none !important;
    color: var(--qph-text) !important;
    font-weight: 800;
}

/* ── Markers ───────────────────────────────────────────────────────────────── */
.qph-marker-pin {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--qph-primary);
    border: 2.5px solid #fff;
    box-shadow: 0 2px 8px rgba(207,46,46,.45);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}
.qph-marker-pin:hover {
    transform: scale(1.5);
    box-shadow: 0 4px 16px rgba(207,46,46,.6);
}
.qph-marker-pin--active {
    background: #fff;
    border-color: var(--qph-primary);
    border-width: 3px;
    transform: scale(1.4);
    box-shadow: 0 0 0 5px rgba(207,46,46,.22);
}
.qph-province-tooltip {
    background: rgba(31,41,55,.96);
    color: #fff;
    border: none !important;
    border-radius: 10px;
    padding: 7px 11px;
    font-weight: 700;
    font-size: .82rem;
    box-shadow: 0 10px 24px rgba(0,0,0,.14);
}
.leaflet-tooltip.qph-province-tooltip::before { display: none; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.qph-sidebar {
    padding: 18px;
    position: sticky;
    top: 16px;
    background: #fff;
    height: fit-content;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #f1c9c9 transparent;
}
.qph-sidebar::-webkit-scrollbar { width: 4px; }
.qph-sidebar::-webkit-scrollbar-thumb { background: #f1c9c9; border-radius: 4px; }

.qph-sidebar-title { margin: 0 0 14px; font-size: 1.2rem; font-weight: 800; color: var(--qph-text); }
.qph-sidebar-top { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid #f3dede; }
.qph-sidebar-products-head h4 { margin: 0 0 4px; font-size: 1rem; font-weight: 800; color: var(--qph-text); }
.qph-sidebar-products-head p  { margin: 0 0 14px; font-size: .92rem; color: var(--qph-muted); }

.qph-select-group { display: grid; gap: 10px; }
.qph-select-label { display: block; margin-bottom: 4px; font-size: .88rem; font-weight: 800; color: var(--qph-text); }
.qph-custom-select {
    width: 100%;
    border: 1px solid var(--qph-border);
    background: #fff;
    color: var(--qph-text);
    border-radius: 14px;
    padding: 11px 14px;
    font-weight: 700;
    font-family: inherit;
    font-size: .88rem;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
    transition: border-color .2s;
}
.qph-custom-select:focus { border-color: var(--qph-primary); }
.qph-custom-select:disabled { opacity: .5; cursor: not-allowed; }

/* ── Products results ──────────────────────────────────────────────────────── */
.qph-products-results { display: flex; flex-direction: column; gap: 12px; }

.qph-products-placeholder,
.qph-products-empty {
    padding: 20px 16px;
    border: 1.5px dashed var(--qph-border);
    border-radius: 18px;
    background: #fff8f8;
    color: var(--qph-muted);
    text-align: center;
    font-size: .9rem;
    line-height: 1.5;
}
.qph-products-grid { display: flex; flex-direction: column; gap: 10px; }

/* ── Skeleton loading ──────────────────────────────────────────────────────── */
@keyframes qphShimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}
.qph-skeleton-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
    padding: 10px;
    border: 1px solid #f3e8e8;
    border-radius: 18px;
}
.qph-skel {
    border-radius: 8px;
    background: linear-gradient(90deg, #f5f0f0 25%, #ede8e8 50%, #f5f0f0 75%);
    background-size: 200% 100%;
    animation: qphShimmer 1.4s infinite;
}
.qph-skel-thumb  { width: 88px; height: 88px; border-radius: 14px; }
.qph-skel-body   { display: flex; flex-direction: column; gap: 9px; padding-top: 6px; }
.qph-skel-line   { height: 10px; }
.qph-skel-line--lg { width: 85%; }
.qph-skel-line--md { width: 55%; }
.qph-skel-line--sm { width: 35%; }

/* ── Product cards ─────────────────────────────────────────────────────────── */
.qph-product-card {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
    align-items: start;
    background: #fff;
    border: 1px solid #f1e4e4;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.04);
    transition: transform .2s ease, box-shadow .2s ease;
}
.qph-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(207,46,46,.09);
}
.qph-product-thumb-wrap {
    display: block;
    width: 88px;
    height: 88px;
    border-radius: 14px;
    overflow: hidden;
    background: #f6f0f0;
    flex-shrink: 0;
}
.qph-product-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.qph-product-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.qph-product-title { margin: 0; font-size: .88rem; line-height: 1.35; font-weight: 800; }
.qph-product-title a {
    color: var(--qph-text);
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.qph-product-title a:hover { color: var(--qph-primary); }
.qph-product-price { font-size: .85rem; font-weight: 800; color: var(--qph-primary); line-height: 1.2; }
.qph-badge-free {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #16a34a;
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: .05em;
    line-height: 1.5;
}
.qph-product-desc {
    font-size: .8rem;
    line-height: 1.45;
    color: var(--qph-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.qph-product-actions { margin-top: 3px; }
.qph-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border-radius: 10px;
    background: #fff4f4;
    color: var(--qph-primary);
    text-decoration: none;
    font-size: .74rem;
    font-weight: 700;
    border: 1px solid #f0d0d0;
    transition: background .18s, color .18s, border-color .18s;
}
.qph-product-btn:hover {
    background: var(--qph-primary);
    color: #fff;
    border-color: var(--qph-primary);
}

/* ── "Ver todas" button ────────────────────────────────────────────────────── */
.qph-products-more { margin-top: 6px; }
.qph-products-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 16px;
    border-radius: 14px;
    background: #fff4f4;
    color: var(--qph-primary);
    text-decoration: none;
    font-weight: 800;
    font-size: .86rem;
    border: 1px solid #f3d5d5;
    transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.qph-products-more-btn:hover {
    background: var(--qph-primary);
    color: #fff;
    border-color: var(--qph-primary);
    transform: translateY(-1px);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .qph-map-shell { grid-template-columns: 1fr; }
    .qph-sidebar   { position: static; max-height: none; }
    .qph-products-results { display: grid; grid-template-columns: repeat(2,1fr); }
    .qph-products-more    { grid-column: 1 / -1; }
    .qph-skeleton-card    { grid-template-columns: 1fr; }
    .qph-skel-thumb       { width: 100%; height: 120px; border-radius: 10px; }
}
@media (max-width: 767px) {
    .qph-spain-map { height: 360px; }
    .qph-product-card          { grid-template-columns: 72px 1fr; gap: 10px; }
    .qph-product-thumb-wrap    { width: 72px; height: 72px; }
    .qph-products-results      { grid-template-columns: 1fr; }
    .qph-skeleton-card         { grid-template-columns: 72px 1fr; }
    .qph-skel-thumb            { width: 72px; height: 72px; border-radius: 10px; }
}
