/* Distributori WECO — frontend
   IMPORTANT: tutto è scopato sotto .dweco e i <button> hanno reset !important
   per neutralizzare i temi WordPress aggressivi (rosso, border-radius, etc.). */

.dweco, .dweco *, .dweco *::before, .dweco *::after {
    font-family: "Ubuntu", Sans-serif !important;
    box-sizing: border-box;
}

.dweco {
    --dw-primary:#1E423E;
    --dw-accent:#5ABB95;
    --dw-gray:#A9A8AD;
    --dw-bg:#f5f5f5;
    --dw-border:#e5e5e5;
    color:#333;
    max-width:1200px;
    margin:0 auto;
    padding:20px;
    background:transparent;
}

/* === RESET aggressivo per neutralizzare il tema WP ================ */
.dweco button {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    background-image: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-radius: 0 !important;
    color: inherit !important;
    font: inherit !important;
    line-height: 1.3 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    padding: 0;
    margin: 0;
    cursor: pointer;
    text-align: left;
}
.dweco button:hover,
.dweco button:focus,
.dweco button:active {
    background: transparent !important;
    background-color: transparent !important;
    color: inherit !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    transform: none !important;
}
.dweco img { border-radius: 0; }
.dweco a { color: inherit; }

/* === Header ======================================================== */
.dweco-header { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; flex-wrap:wrap; margin-bottom:24px; }
.dweco-kicker { display:inline-flex; align-items:center; gap:8px; color:var(--dw-accent); font-size:11px; font-weight:600; letter-spacing:.18em; text-transform:uppercase; margin-bottom:10px; }
.dweco-kicker-line { display:inline-block; width:24px; height:1px; background:var(--dw-accent); }
.dweco-title { font-size:32px; font-weight:600; color:var(--dw-primary); margin:0 0 8px; line-height:1.15; }
.dweco-subtitle { font-size:14px; color:#666; margin:0; max-width:480px; }
.dweco-stats { display:flex; gap:10px; }
.dweco-stat { background:#fff; border:1px solid var(--dw-border); border-radius:999px; padding:8px 16px; font-size:14px; }
.dweco-stat strong { color:var(--dw-primary); font-weight:700; margin-right:6px; }
.dweco-stat span { color:#888; }

/* === Tabs macroaree ================================================ */
.dweco-section-tag {
    display:block;
    font-size:11px;
    font-weight:700;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:#888;
    margin:4px 2px 8px;
}
.dweco-tabs { background:#fff; border:1px solid var(--dw-border); border-radius:16px; padding:6px; margin-bottom:20px; display:flex; gap:4px; flex-wrap:wrap; }
.dweco-tab {
    display:inline-flex !important;
    align-items:center;
    gap:8px;
    padding:10px 16px !important;
    border-radius:10px !important;
    background:transparent !important;
    color:#525252 !important;
    font-size:12px !important;
    font-weight:600 !important;
    letter-spacing:.06em !important;
    text-transform:uppercase !important;
    transition: background-color .15s, color .15s;
}
.dweco-tab:hover {
    background:#f3f4f4 !important;
    color:var(--dw-primary) !important;
}
.dweco-tab.is-active,
.dweco-tab.is-active:hover,
.dweco-tab.is-active:focus {
    background:var(--dw-primary) !important;
    color:#fff !important;
    border-radius:10px !important;
}
.dweco-tab .dweco-tab-count { font-size:10px; font-weight:700; padding:2px 7px; border-radius:999px; background:#f4f4f5; color:#737373; }
.dweco-tab:hover .dweco-tab-count { background:#e8e8e8; color:#444; }
.dweco-tab.is-active .dweco-tab-count,
.dweco-tab.is-active:hover .dweco-tab-count { background:rgba(255,255,255,.18); color:#fff; }
.dweco-tab svg { width:14px; height:14px; opacity:.6; }
.dweco-tab.is-active svg,
.dweco-tab.is-active:hover svg { opacity:1; }

/* === Grid ========================================================== */
.dweco-grid { display:grid; grid-template-columns: minmax(0, 1fr) 340px; gap:20px; align-items:stretch; }
@media (max-width: 880px) { .dweco-grid { grid-template-columns: 1fr; } }

/* === Map + pin ===================================================== */
.dweco-map-wrap { background:#fff; border:1px solid var(--dw-border); border-radius:16px; padding:18px; display:flex; flex-direction:column; }
.dweco-map-wrap .dweco-map { flex:1; }
/* Leaflet map container */
.dweco-leaflet {
    width:100%;
    aspect-ratio: 2 / 1;
    min-height: 420px;
    border-radius:10px;
    overflow:hidden;
    background:#eef0f2;
    flex:1;
}
.dweco-map-wrap > .dweco-leaflet { height:100%; }

/* Custom marker */
.dweco .leaflet-container { font-family: inherit; border-radius:10px; }
.dweco .leaflet-control-attribution { font-size:10px; }
.dweco-mk { background:transparent !important; border:0 !important; }
.dweco-mk-dot {
    display:block;
    width:14px; height:14px;
    border-radius:50%;
    background:var(--dw-primary);
    box-shadow:0 0 0 3px #fff, 0 1px 4px rgba(0,0,0,.35);
    transition: transform .15s, background-color .15s, box-shadow .15s;
    cursor:pointer;
}
.dweco-mk:hover .dweco-mk-dot {
    background:var(--dw-accent);
    transform:scale(1.15);
    box-shadow:0 0 0 3px #fff, 0 0 0 6px rgba(90,187,149,.30);
}
.dweco-mk-dot.is-active {
    background:var(--dw-accent);
    transform:scale(1.25);
    box-shadow:0 0 0 3px #fff, 0 0 0 7px rgba(90,187,149,.40);
}
.dweco .leaflet-tooltip {
    background:var(--dw-primary) !important;
    color:#fff !important;
    border:0 !important;
    border-radius:6px !important;
    padding:5px 10px !important;
    font-size:12px !important;
    font-weight:700 !important;
    text-transform:uppercase !important;
    letter-spacing:.02em !important;
    box-shadow:0 4px 10px rgba(0,0,0,.18) !important;
}
.dweco .leaflet-tooltip-top:before { border-top-color:var(--dw-primary) !important; }

/* === Sidebar ======================================================= */
.dweco-sidebar { background:#fff; border:1px solid var(--dw-border); border-radius:16px; overflow:hidden; display:flex; flex-direction:column; height:100%; max-height:560px; min-height:420px; position:relative; }
.dweco-sidebar-close {
    display:none;
    position:absolute; top:10px; right:12px;
    width:32px; height:32px;
    font-size:24px !important;
    line-height:1 !important;
    color:#666 !important;
    z-index:2;
    text-align:center !important;
}
.dweco-sidebar-inner { display:flex; flex-direction:column; height:100%; }

/* head */
.dweco-side-head { padding:16px 18px 14px; border-bottom:1px solid #f0f0f0; }
.dweco-side-back {
    display:inline-flex !important;
    align-items:center;
    gap:6px;
    font-size:11px !important;
    font-weight:600 !important;
    text-transform:uppercase !important;
    letter-spacing:.06em !important;
    color:#737373 !important;
    padding:6px 10px 6px 6px !important;
    border-radius:6px !important;
    margin-bottom:10px;
    transition: background-color .15s, color .15s;
}
.dweco-side-back:hover {
    background:#f3f4f4 !important;
    color:var(--dw-primary) !important;
}
.dweco-side-back svg { width:14px; height:14px; }
.dweco-side-tag { font-size:10px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:#a3a3a3; }
.dweco-side-title { font-size:15px; font-weight:600; color:var(--dw-primary); margin:2px 0 12px; }
.dweco-side-search { position:relative; }
.dweco-side-search input { width:100% !important; padding:11px 14px 11px 38px !important; border-radius:8px !important; border:1px solid transparent !important; background:#f4f4f5 !important; font-size:14px !important; box-sizing:border-box !important; line-height:1.3 !important; }
.dweco-side-search input:focus { outline:none; border-color:#e0e0e0; background:#fff; }
.dweco-side-search svg { position:absolute; left:13px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:#a3a3a3; pointer-events:none; z-index:1; }

/* list */
.dweco-side-list { flex:1; overflow-y:auto; }
.dweco-side-item {
    display:flex !important;
    align-items:center;
    gap:12px;
    width:100%;
    padding:12px 16px !important;
    border-radius:0 !important;
    border-bottom:1px solid #f0f0f0 !important;
    border-left:3px solid transparent !important;
    background:#fff !important;
    text-align:left !important;
    transition: background-color .15s;
}
.dweco-side-item:hover {
    background:#ededed !important;
    color:inherit !important;
    border-left-color:transparent !important;
}
.dweco-side-item.is-active,
.dweco-side-item.is-active:hover {
    background:rgba(90,187,149,.08) !important;
    border-left-color:var(--dw-accent) !important;
}
.dweco-side-icon { display:none !important; }
.dweco-side-item.is-active .dweco-side-icon { display:none !important; }
.dweco-side-text { flex:1; min-width:0; }
.dweco-side-name { display:block; font-size:13.5px; font-weight:600; color:var(--dw-primary); text-transform:uppercase; letter-spacing:.02em; }
.dweco-side-meta { display:block; font-size:12px; color:#888; margin-top:2px; }
.dweco-side-chevron { color:#ccc; flex-shrink:0; display:flex; align-items:center; }
.dweco-side-chevron svg { width:14px; height:14px; }

/* === Bottom card =================================================== */
.dweco-bottom-card { margin-top:20px; background:#fff; border:1px solid var(--dw-border); border-radius:16px; padding:20px 24px; display:none; align-items:center; gap:20px; flex-wrap:wrap; }
.dweco-bottom-card.is-visible { display:flex; }
.dweco-bottom-icon { display:none !important; }
.dweco-bottom-info { flex:1; min-width:240px; }
.dweco-bottom-tag { font-size:10px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:#888; margin-bottom:2px; }
.dweco-bottom-name { font-size:17px; font-weight:700; color:var(--dw-primary); margin-bottom:6px; text-transform:uppercase; letter-spacing:.02em; }
.dweco-bottom-row { display:flex; gap:18px; flex-wrap:wrap; font-size:12.5px; color:#555; }
.dweco-bottom-row a { color:inherit; text-decoration:none; }
.dweco-bottom-row a:hover { color:var(--dw-primary); }
.dweco-bottom-row span { display:inline-flex; align-items:center; gap:6px; }
.dweco-bottom-row svg { color:#a3a3a3; width:14px; height:14px; }
.dweco .dweco-bottom-cta,
.dweco .dweco-bottom-cta:link,
.dweco .dweco-bottom-cta:visited {
    background:var(--dw-accent) !important;
    background-color:var(--dw-accent) !important;
    color:#fff !important;
    padding:14px 22px !important;
    border-radius:12px !important;
    font-size:15px !important;
    font-weight:700 !important;
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:0 !important;
    text-decoration:none !important;
    text-transform:none !important;
    line-height:1.2 !important;
    box-shadow:0 4px 12px rgba(90,187,149,.35) !important;
    transition: background-color .15s, box-shadow .15s, transform .15s;
    cursor:pointer;
}
.dweco .dweco-bottom-cta:hover,
.dweco .dweco-bottom-cta:focus { background:#48a481 !important; background-color:#48a481 !important; color:#fff !important; box-shadow:0 6px 16px rgba(90,187,149,.45) !important; transform:translateY(-1px); }
.dweco .dweco-bottom-cta svg { width:14px !important; height:14px !important; color:#fff !important; stroke:#fff !important; }

/* === Empty hint ==================================================== */
.dweco-hint { margin-top:20px; background:#fff; border:1px dashed var(--dw-border); border-radius:14px; padding:16px; text-align:center; font-size:13px; color:#888; display:flex; align-items:center; justify-content:center; gap:8px; }
.dweco-hint svg { color:var(--dw-accent); width:14px; height:14px; }

/* === Popup ========================================================= */
.dweco-popup { position:fixed; inset:0; z-index:99999; display:flex; align-items:center; justify-content:center; padding:20px; }
.dweco-popup[hidden] { display:none; }
.dweco-popup-backdrop { position:absolute; inset:0; background:rgba(30,66,62,.15); backdrop-filter: blur(2px); }
.dweco-popup-dialog { position:relative; width:100%; max-width:640px; background:#fff; border-radius:16px; overflow:hidden; box-shadow:0 30px 80px -10px rgba(0,0,0,.35); max-height:calc(100vh - 40px); display:flex; flex-direction:column; }
.dweco-popup-x {
    position:absolute; top:12px; right:12px;
    width:36px; height:36px;
    border:0 !important;
    background:transparent !important;
    border-radius:50% !important;
    color:#1E423E !important;
    font-size:22px !important;
    line-height:1 !important;
    text-align:center !important;
    cursor:pointer;
    z-index:2;
    transition: background-color .15s;
}
.dweco-popup-x:hover { background:rgba(30,66,62,.08) !important; color:#1E423E !important; }
.dweco-popup-body { padding:32px 28px 28px; overflow-y:auto; }
.dweco-no-form { color:#a06; background:#fff5f8; border:1px solid #f9c; border-radius:8px; padding:14px; font-size:13px; }

/* === Mobile drawer ================================================= */
.dweco button.dweco-mobile-toggle,
.dweco .dweco-mobile-toggle {
    display:none;
    width:100% !important;
    box-sizing:border-box !important;
    align-items:center !important;
    justify-content:space-between !important;
    gap:10px !important;
    background:#1E423E !important;
    background-color:#1E423E !important;
    background-image:none !important;
    border:0 !important;
    outline:0 !important;
    padding:16px 20px !important;
    border-radius:12px !important;
    font-size:16px !important;
    font-weight:700 !important;
    color:#ffffff !important;
    text-decoration:none !important;
    text-transform:none !important;
    line-height:1.2 !important;
    margin:16px 0 18px !important;
    box-shadow:0 6px 18px rgba(30,66,62,.30) !important;
    cursor:pointer;
    transition: background-color .15s, transform .15s, box-shadow .15s;
    -webkit-appearance:none !important;
    appearance:none !important;
}
.dweco button.dweco-mobile-toggle:hover,
.dweco button.dweco-mobile-toggle:focus,
.dweco button.dweco-mobile-toggle:active {
    background:#16312e !important;
    background-color:#16312e !important;
    color:#ffffff !important;
    transform:translateY(-1px);
    box-shadow:0 8px 22px rgba(30,66,62,.40) !important;
}
.dweco .dweco-mobile-toggle span { color:#ffffff !important; }
.dweco .dweco-mobile-toggle svg { color:#ffffff !important; stroke:#ffffff !important; flex-shrink:0; }
@media (max-width: 880px) {
    .dweco button.dweco-mobile-toggle,
    .dweco .dweco-mobile-toggle { display:flex !important; }
    .dweco-grid { grid-template-columns: 1fr; }
    .dweco-leaflet { aspect-ratio: 4 / 3; min-height: 0; }
    .dweco-map-wrap { padding:10px; }
    .dweco-sidebar {
        position:fixed; top:0; right:0; bottom:0; left:0;
        width:100%; max-width:none; height:100vh; max-height:100vh; min-height:100vh;
        transform:translateX(110%);
        transition:transform .25s ease;
        z-index:9999;
        border-radius:0;
    }
    .dweco-sidebar.is-open { transform:translateX(0); }
    .dweco-sidebar-close { display:block; }
    .dweco-stats { display:none; }
    .dweco-title { font-size:24px; }
    .dweco-popup-dialog { max-width:100%; }
    .dweco-popup-body { padding:28px 18px 18px; }
    /* Bottom card full-width on mobile */
    .dweco-bottom-card { padding:18px; gap:14px; flex-direction:column; align-items:stretch; }
    .dweco-bottom-info { min-width:0; width:100%; }
    .dweco-bottom-name { font-size:18px; margin-bottom:8px; }
    .dweco-bottom-row { gap:10px 18px; font-size:13px; flex-direction:column; }
    .dweco .dweco-bottom-cta { width:100% !important; justify-content:center !important; padding:16px 20px !important; font-size:16px !important; }
    /* Tabs: smaller, wrap nicely */
    .dweco-tabs { padding:6px; }
    .dweco-tab { padding:8px 10px !important; font-size:12.5px !important; }
}
