﻿.gommisti-page,
.gommista-detail-page {
    background: #f8f9fa;
    min-height: 65vh;
}

.gommisti-page .breadcrumb a,
.gommista-detail-page .breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.gommisti-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f4f6f8 100%);
    border: 1px solid #e9ecef;
}

.gommisti-search-card {
    border: 1px solid #e9ecef;
}

.gommista-card {
    position: relative;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.gommista-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 .75rem 2rem rgba(0,0,0,.07);
    border-color: #ced4da !important;
}

.gommista-address {
    min-height: 2.75rem;
    color: #343a40;
}

.gommisti-seo-box {
    background: #fff;
}

.gommista-head,
.gommista-contact-card,
.gommista-detail-page section {
    box-shadow: 0 .25rem 1.25rem rgba(0,0,0,.035);
}

.gommista-service {
    background: #fbfbfc;
}

.gommista-description {
    color: #343a40;
    line-height: 1.7;
}

.gommista-preline {
    white-space: pre-line;
}

.gommista-claim-box {
    background: #fff;
    border-style: dashed !important;
}

.gommista-contact-card {
    top: 6.5rem;
}

.gommista-contact-card textarea {
    resize: vertical;
    min-height: 130px;
}

.gommista-detail-page .accordion-button:not(.collapsed) {
    background: transparent;
    color: #111;
    box-shadow: none;
}

.gommista-detail-page .accordion-button:focus {
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .gommista-contact-card {
        position: static !important;
    }
}


/* Gommisti - lista e mappa */
.gommisti-map-card {
    box-shadow: 0 .25rem 1.25rem rgba(0,0,0,.035);
}

.gommisti-map {
    width: 100%;
    height: 390px;
    min-height: 390px;
    background: #eef1f4;
    position: relative;
    isolation: isolate;
}

.gommista-card .badge {
    max-width: 100%;
    white-space: normal;
    text-align: left;
}

.gommista-card.is-map-active {
    border-color: #212529 !important;
    box-shadow: 0 .75rem 2rem rgba(0,0,0,.08);
}

.gommisti-map-popup {
    min-width: 215px;
}

.gommisti-map-popup .gommisti-map-popup-name {
    font-weight: 700;
    margin-bottom: .25rem;
}

.gommisti-map-popup .gommisti-map-popup-meta,
.gommisti-map-popup .gommisti-map-popup-services {
    color: #6c757d;
    font-size: .85rem;
    margin-bottom: .45rem;
}

.gommisti-map-popup .gommisti-map-popup-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
}

.gommisti-map-popup .gommisti-map-popup-actions a {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    font-size: .85rem;
}

@media (max-width: 767.98px) {
    .gommisti-map {
        height: 320px;
        min-height: 320px;
    }
}


/* ============================================================
   Leaflet core fallback locale
   Manteniamo queste regole nel nostro CSS perché la pagina non
   deve dipendere dal caricamento del foglio stile Leaflet esterno.
   ============================================================ */

.leaflet-container {
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    outline: 0;
    font-family: inherit;
    background: #dde3e8;
}

.leaflet-container.leaflet-touch-zoom {
    touch-action: pan-x pan-y;
}

.leaflet-container.leaflet-touch-drag {
    touch-action: none;
    touch-action: pinch-zoom;
}

.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
    touch-action: none;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer {
    position: absolute;
    left: 0;
    top: 0;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container {
    user-select: none;
    -webkit-user-drag: none;
}

.leaflet-tile {
    width: 256px !important;
    height: 256px !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    visibility: hidden;
}

.leaflet-tile-loaded {
    visibility: inherit;
}

.leaflet-zoom-animated {
    transform-origin: 0 0;
}

.leaflet-map-pane {
    z-index: 100;
}

.leaflet-tile-pane {
    z-index: 200;
}

.leaflet-overlay-pane {
    z-index: 400;
}

.leaflet-shadow-pane {
    z-index: 500;
}

.leaflet-marker-pane {
    z-index: 600;
}

.leaflet-tooltip-pane {
    z-index: 650;
}

.leaflet-popup-pane {
    z-index: 700;
}

.leaflet-map-pane canvas {
    z-index: 100;
}

.leaflet-map-pane svg {
    z-index: 200;
}

.leaflet-pane > svg path,
.leaflet-tile-container {
    pointer-events: none;
}

.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-pane > canvas {
    pointer-events: auto;
}

.leaflet-control {
    position: relative;
    z-index: 800;
    pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.leaflet-top {
    top: 0;
}

.leaflet-right {
    right: 0;
}

.leaflet-bottom {
    bottom: 0;
}

.leaflet-left {
    left: 0;
}

.leaflet-control {
    float: left;
    clear: both;
}

.leaflet-right .leaflet-control {
    float: right;
}

.leaflet-top .leaflet-control {
    margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
    margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
    margin-left: 10px;
}

.leaflet-right .leaflet-control {
    margin-right: 10px;
}

.leaflet-control-zoom {
    border: 1px solid rgba(0,0,0,.15);
    border-radius: .5rem;
    overflow: hidden;
    box-shadow: 0 .15rem .6rem rgba(0,0,0,.12);
}

.leaflet-control-zoom a {
    display: block;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    text-decoration: none;
    background: #fff;
    color: #212529;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid #dee2e6;
}

.leaflet-control-zoom a:last-child {
    border-bottom: 0;
}

.leaflet-control-zoom a:hover {
    background: #f8f9fa;
}

.leaflet-control-attribution {
    margin: 0 !important;
    padding: 2px 6px;
    background: rgba(255,255,255,.88);
    color: #495057;
    font-size: 10px;
    line-height: 1.35;
}

.leaflet-control-attribution a {
    color: inherit;
}

.leaflet-popup {
    position: absolute;
    text-align: center;
    margin-bottom: 20px;
}

.leaflet-popup-content-wrapper {
    border-radius: .75rem;
    background: #fff;
    box-shadow: 0 .35rem 1.4rem rgba(0,0,0,.2);
    text-align: left;
}

.leaflet-popup-content {
    margin: 14px 16px;
    line-height: 1.45;
}

.leaflet-popup-tip-container {
    width: 40px;
    height: 20px;
    position: absolute;
    left: 50%;
    margin-left: -20px;
    overflow: hidden;
    pointer-events: none;
}

.leaflet-popup-tip {
    width: 17px;
    height: 17px;
    padding: 1px;
    margin: -10px auto 0;
    transform: rotate(45deg);
    background: #fff;
    box-shadow: 3px 3px 4px rgba(0,0,0,.12);
}

.leaflet-popup-close-button {
    position: absolute;
    top: 0;
    right: 0;
    border: 0;
    padding: 7px 8px 0 0;
    color: #6c757d;
    background: transparent;
    font: 22px/18px Arial, Helvetica, sans-serif;
    text-decoration: none;
    z-index: 1;
}

.leaflet-popup-close-button:hover {
    color: #212529;
}

.leaflet-fade-anim .leaflet-popup {
    opacity: 0;
    transition: opacity .2s linear;
}

.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
    opacity: 1;
}

.leaflet-zoom-anim .leaflet-zoom-animated {
    transition: transform .25s cubic-bezier(0,0,.25,1);
}

.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
    transition: none;
}

.leaflet-grab {
    cursor: grab;
}

.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive {
    cursor: grabbing;
}

.leaflet-interactive {
    cursor: pointer;
}

.leaflet-container a {
    -webkit-tap-highlight-color: rgba(51,181,229,.4);
}

.leaflet-container img {
    max-width: none !important;
}


/* ============================================================
   Scheda singola gommista - mappa posizione
   ============================================================ */

.gommista-detail-map-shell {
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    background: #eef1f4;
}

.gommista-detail-map {
    width: 100%;
    height: 280px;
    min-height: 280px;
    position: relative;
    isolation: isolate;
    background: #eef1f4;
}

.gommista-detail-map .leaflet-control-attribution {
    font-size: 9px;
}

@media (max-width: 767.98px) {
    .gommista-detail-map {
        height: 240px;
        min-height: 240px;
    }
}


/* ============================================================
   Fase 9 - logo e immagine officina
   ============================================================ */

.min-w-0 {
    min-width: 0;
}

.gommista-public-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    padding: .55rem;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 1rem;
    background: #fff;
}

.gommista-public-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gommista-public-photo-card {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin: 0;
}

.gommista-public-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 767.98px) {
    .gommista-public-logo-wrap {
        width: 72px;
        height: 72px;
        border-radius: .85rem;
    }
}

/* ============================================================
   Deep link commerciali - scheda gommista
   ============================================================ */

.cmp-affiliate-wrap {
    position: relative;
    overflow: hidden;
}

.cmp-affiliate-disclosure {
    max-width: 360px;
}

.cmp-affiliate-card {
    position: relative;
    background: #fff;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cmp-affiliate-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 1rem;
    right: 1rem;
    height: 3px;
    border-radius: 0 0 999px 999px;
    background: #dc3545;
    opacity: .9;
}

.cmp-affiliate-card:hover,
.cmp-affiliate-card:focus-visible {
    transform: translateY(-3px);
    border-color: #adb5bd !important;
    box-shadow: 0 .9rem 2rem rgba(0, 0, 0, .08);
}

.cmp-affiliate-card:focus-visible {
    outline: 3px solid rgba(13, 110, 253, .2);
    outline-offset: 2px;
}

.cmp-affiliate-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    background: #f8f9fa;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .03em;
}

.cmp-affiliate-arrow {
    font-size: 1.3rem;
    line-height: 1;
    color: #6c757d;
    transition: transform .18s ease;
}

.cmp-affiliate-card:hover .cmp-affiliate-arrow {
    transform: translate(2px, -2px);
}

@media (max-width: 767.98px) {
    .cmp-affiliate-card {
        min-height: 0;
    }

    .cmp-affiliate-disclosure {
        max-width: none;
    }
}


/* Affiliate v1.2: loghi merchant */
.cmp-affiliate-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 48px;
    padding: .35rem .45rem;
    border: 1px solid #dee2e6;
    border-radius: .85rem;
    background: #fff;
}

.cmp-affiliate-logo {
    display: block;
    max-width: 100%;
    max-height: 34px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.cmp-affiliate-brand .cmp-affiliate-mark {
    width: 40px;
    height: 40px;
}

.cmp-affiliate-mark-fallback {
    display: none;
}

.cmp-affiliate-logo[src=""] {
    display: none;
}

.cmp-affiliate-logo[src=""] + .cmp-affiliate-mark-fallback {
    display: inline-flex;
}


/* Affiliate v1.3: logo pulito e proporzioni uniformi */
.cmp-affiliate-brand {
    width: 92px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
}

.cmp-affiliate-logo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 92px;
    max-height: 52px;
    object-fit: contain;
    object-position: left center;
}

.cmp-affiliate-brand .cmp-affiliate-mark-fallback {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
}

.cmp-affiliate-mark-fallback {
    display: none !important;
}

.cmp-affiliate-logo[src=""] {
    display: none !important;
}

.cmp-affiliate-logo[src=""] + .cmp-affiliate-mark-fallback {
    display: inline-flex !important;
}
