/* =============================================
   MAC Baterias - Custom CSS for WordPress/Elementor
   ============================================= */

:root {
    --mac-bg: #000000;
    --mac-white: #ffffff;
    --mac-red: #ff0000;
    --mac-green: #299f0f;
    --mac-orange: #f8981d;
    --mac-grey: #666666;
    --mac-max-width: 600px;
}

/* === GLOBAL OVERRIDES === */
html,
body {
    background-color: var(--mac-bg) !important;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif !important;
    color: var(--mac-white);
}

/* Remove Elementor default padding */
.elementor-section.elementor-section-boxed>.elementor-container {
    max-width: var(--mac-max-width) !important;
}

.elementor-page .elementor-widget-wrap {
    padding: 0 !important;
}

/* Force all Elementor sections to have black bg and max-width */
.elementor-section {
    background-color: var(--mac-bg) !important;
    margin-bottom: 10px !important;
}

/* Remove gap from last section before footer */
.elementor-section:last-child {
    margin-bottom: 0 !important;
}

.elementor-inner-section .elementor-container {
    max-width: 100% !important;
}

/* Center the page content */
.site-main,
.elementor {
    max-width: var(--mac-max-width);
    margin: 0 auto;
}

/* Offset for fixed header anchors - accounts for header + WP admin bar */
[id="urgencias"],
[id="baterias-mac"],
[id="offer"],
[id="mac-models"],
[id="mac-models-list"],
[id="baterias-mr"],
[id="empresa"],
[id="gallery-carousel"],
[id="como-llegar"] {
    scroll-margin-top: 120px !important;
}

/* When WP admin bar is visible, header shifts down */
.admin-bar .mac-site-header {
    top: 32px;
}

.admin-bar .mac-header-spacer {
    height: 132px;
}

/* === FIXED HEADER === */
.mac-site-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--mac-max-width);
    z-index: 10000;
    background-color: var(--mac-bg);
    text-align: center;
    padding: 6px 20px;
    border-bottom: 2px solid var(--mac-grey);
    box-sizing: border-box;
}

.mac-header-logo {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.mac-header-spacer {
    height: 100px;
    width: 100%;
    display: block;
}

/* === FIXED FOOTER DOCK === */
.mac-footer-dock {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--mac-max-width);
    background-color: var(--mac-bg);
    padding: 10px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 2px solid var(--mac-grey);
    box-sizing: border-box;
}

.mac-footer-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.mac-footer-btn {
    flex: 1;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 0.9rem;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.1;
}

.mac-btn-grey {
    background-color: var(--mac-grey);
    color: var(--mac-white);
}

.mac-btn-orange {
    background-color: var(--mac-orange);
    color: #000;
}

.mac-btn-red {
    background-color: var(--mac-red);
    color: var(--mac-white);
}

.mac-btn-green {
    background-color: var(--mac-green);
    color: var(--mac-white);
}

.mac-footer-address {
    width: 100%;
    background-color: var(--mac-grey);
    color: var(--mac-white);
    text-align: center;
    font-weight: 900;
    padding: 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.mac-footer-spacer {
    height: 180px;
    width: 100%;
    display: block;
}

/* === SECTION: URGENCIAS & BATERIAS === */
.mac-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: nowrap;
    gap: 10px;
}

.mac-section-title {
    font-size: 1.8rem !important;
    font-weight: 900 !important;
    color: var(--mac-red) !important;
    text-transform: lowercase !important;
    margin: 0 !important;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 !important;
    line-height: 1 !important;
}

.mac-section-actions {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    flex-grow: 1;
}

.mac-btn-small {
    padding: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.mac-btn-small.red {
    background-color: var(--mac-red);
}

.mac-btn-small.green {
    background-color: var(--mac-green);
}

/* Orange Pills */
.mac-info-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.mac-pill-item {
    background-color: var(--mac-orange);
    color: #000;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 900;
    font-size: 1.1rem;
    text-align: center;
}

.mac-pill-item i,
.mac-pill-item em {
    color: var(--mac-white);
    font-style: italic;
    font-weight: 900;
    text-transform: uppercase;
}

/* Grey Bars (Horario) */
.mac-bar-grey {
    background-color: var(--mac-grey);
    color: white;
    padding: 6px 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
    border-radius: 4px;
    margin-bottom: 6px;
}

.mac-bar-grey.dark {
    background-color: #666;
}

/* === SECTION: OFERTA === */
.mac-offer-card {
    background-color: var(--mac-red);
    width: 100%;
    border-radius: 0;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    border: none;
    box-sizing: border-box;
}

.mac-offer-title {
    color: var(--mac-white) !important;
    font-size: 2.4rem !important;
    font-weight: 900 !important;
    line-height: 0.9 !important;
    margin: 0 !important;
    text-transform: uppercase;
    align-self: flex-start;
    text-align: left;
    width: 100%;
    padding-left: 10px;
}

.mac-offer-price {
    background-color: var(--mac-white);
    color: #000;
    font-weight: 900;
    font-size: 1.4rem;
    padding: 10px 30px;
    border-radius: 100px;
    white-space: nowrap;
    margin-top: 5px;
    align-self: flex-start;
    margin-left: 10px;
    text-align: center;
}

.mac-offer-card img {
    width: 100%;
    max-width: 380px;
    height: auto;
    object-fit: contain;
    margin: 5px auto 0;
    display: block;
}

.mac-offer-details {
    text-align: center;
    color: var(--mac-white);
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 5px;
}

.mac-offer-details .line {
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    margin: 0;
}

.mac-offer-details .amp {
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0;
}

/* === SECTION: LINEA TITANIO === */
.mac-titanio-card {
    background-color: var(--mac-red);
    width: 100%;
    border-radius: 0;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: none;
    box-sizing: border-box;
}

.mac-titanio-title {
    color: #000 !important;
    font-size: 2rem !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    margin: 0 0 10px 0 !important;
    line-height: 1.1 !important;
}

.mac-titanio-subtitle {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--mac-white);
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
}

.mac-titanio-feature {
    font-size: 1rem;
    font-weight: bold;
    color: var(--mac-white);
    margin: 5px 0 15px 0;
}

.mac-titanio-card img.mac-titanio-img {
    width: 80%;
    max-width: 250px;
    height: auto;
    object-fit: contain;
    margin: 10px auto;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.3));
}

.mac-titanio-footer {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--mac-white);
    margin-top: 10px;
    padding: 5px 15px;
}

/* === SECTION: PRODUCT MODELS (MAC + MOURA) === */
.mac-models-card {
    background-color: var(--mac-red);
    width: 100%;
    border-radius: 0;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: none;
    box-sizing: border-box;
    overflow: visible !important;
}

.mac-rows-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible !important;
}

.mac-product-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-right: -20px;
    border-bottom: 20px solid var(--mac-orange);
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

.mac-product-row:first-child {
    padding-top: 0px;
    border-top: 20px solid var(--mac-orange);
}

.mac-product-row:last-child {
    padding-bottom: 0px;
    border-bottom: 20px solid var(--mac-orange);
    margin-bottom: 0;
}

.mac-product-row img {
    width: 50%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.mac-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: justify;
    padding-left: 20px;
    overflow: visible !important;
}

.mac-product-title {
    font-size: 1.6rem;
    font-weight: 900;
    text-transform: uppercase;
    margin: 0 0 5px 0;
    color: var(--mac-white);
    line-height: 1;
    width: 100%;
}

.mac-rendimiento-label {
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 4px;
    color: #000;
}

/* Performance Chart */
.mac-performance-chart {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    width: 100%;
    max-width: 260px;
    position: relative;
    z-index: 10;
    overflow: visible !important;
}

.mac-perf-segment {
    height: 22px;
    flex: 1;
    border: 1px solid white;
    position: relative;
    overflow: visible !important;
}

.mac-perf-green {
    background-color: var(--mac-green);
}

.mac-perf-yellow {
    background-color: #fff200;
}

.mac-perf-orange {
    background-color: var(--mac-orange);
}

.mac-perf-red {
    background-color: var(--mac-red);
}

.mac-perf-dot {
    width: 32px;
    height: 32px;
    background-color: red;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: macPulseDot 1.5s ease-in-out infinite;
}

@keyframes macPulseDot {

    0%,
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.mac-features-text {
    font-size: 0.9rem;
    font-weight: bold;
    color: #000;
    line-height: 1.2;
    text-transform: uppercase;
}

/* === SECTION: EMPRESA === */
.mac-empresa-title {
    color: white !important;
    margin-bottom: 8px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    font-size: 1.3rem !important;
    font-weight: 900 !important;
}

.mac-empresa-card {
    background: var(--mac-orange);
    border-radius: 0;
    padding: 25px 100px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    color: black;
    box-sizing: border-box;
}

.mac-empresa-content p {
    font-weight: 600;
    font-size: 0.8rem;
    line-height: 1.2;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.mac-empresa-content p:last-child {
    margin-bottom: 0;
}

.mac-highlight-yellow {
    color: #fffb00;
}

.mac-diploma-container {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.mac-diploma-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border: 5px solid white;
}

/* === SECTION: GALERIA CAROUSEL === */
.mac-carousel-section {
    background-color: var(--mac-bg);
    padding: 1rem;
}

.mac-gallery-title {
    color: white !important;
    margin-bottom: 8px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    font-size: 1.3rem !important;
    font-weight: 900 !important;
}

.mac-carousel-container {
    position: relative;
    width: 100%;
}

.mac-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: 0;
}

.mac-carousel-track::-webkit-scrollbar {
    display: none;
}

.mac-carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    position: relative;
}

.mac-carousel-slide img {
    width: 116%;
    height: auto;
    border-radius: 0;
    display: block;
    object-fit: cover;
    aspect-ratio: 3/4;
}

.mac-carousel-caption {
    position: absolute;
    bottom: 35px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--mac-red);
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 1px 1px 0 var(--mac-white), -1px -1px 0 var(--mac-white), 1px -1px 0 var(--mac-white), -1px 1px 0 var(--mac-white);
    text-align: center;
    width: 90%;
    z-index: 15;
    line-height: 1.2;
}

.mac-carousel-btn {
    position: absolute;
    bottom: 15px;
    top: auto;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.mac-carousel-btn:hover {
    background-color: var(--mac-orange);
}

.mac-carousel-btn.prev {
    left: 10px;
}

.mac-carousel-btn.next {
    right: 10px;
}

/* === SECTION: COMO LLEGAR === */
.mac-map-title {
    font-size: 1.3rem !important;
    text-align: center !important;
    text-transform: uppercase !important;
    color: white !important;
    margin-bottom: 8px !important;
    font-weight: 900 !important;
}

.mac-map-container {
    width: 100%;
    height: 300px;
    background: grey;
    border-radius: 0;
    overflow: hidden;
}

.mac-map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* === MOBILE RESPONSIVE === */
@media (max-width: 600px) {
    .mac-offer-card {
        min-height: 495px;
    }

    .mac-titanio-card {
        min-height: 495px;
    }

    .mac-models-card {
        min-height: 495px;
        display: flex;
        flex-direction: column;
    }

    .mac-empresa-card {
        background: var(--mac-orange);
        border-radius: 0;
        padding: 25px;
        max-width: 600px;
        margin: 0 auto;
        text-align: center;
        color: black;
        box-sizing: border-box;
    }

    .mac-carousel-container {
        min-height: 420px;
    }

    .mac-map-container {
        min-height: 495px !important;
        height: 495px !important;
    }

    /* Mobile product rows */
    .mac-product-row {
        flex-direction: row;
        text-align: justify;
        gap: 0;
        align-items: center;
        padding: 0px 8px;
        width: calc(100% + 40px);
        margin-left: -20px;
        margin-right: -20px;
        border-bottom: 12px solid var(--mac-orange);
    }

    .mac-product-row:first-child {
        border-top: 12px solid var(--mac-orange);
    }

    .mac-product-row:last-child {
        border-bottom: 12px solid var(--mac-orange);
    }

    .mac-product-info {
        align-items: flex-start;
        text-align: justify;
        padding-left: 10px;
        min-width: 0;
    }

    .mac-product-title {
        font-size: 1.0rem;
        margin-bottom: 1px;
    }

    .mac-rendimiento-label {
        font-size: 0.6rem;
        margin-bottom: 1px;
    }

    .mac-performance-chart {
        max-width: 160px;
        margin-bottom: 2px;
    }

    .mac-perf-segment {
        height: 10px;
    }

    .mac-perf-dot {
        width: 18px;
        height: 18px;
        border-width: 1px;
    }

    .mac-features-text {
        font-size: 0.6rem;
        line-height: 1.1;
    }

    .mac-empresa-content p {
        font-size: 12px;
    }
}

/* === DESKTOP RESPONSIVE === */
@media (min-width: 601px) {

    /* Manteniamo tutto a 600px anche su desktop, quindi non sovrascriviamo più la variabile width */
    .mac-header-spacer {
        height: 100px;
        /* Ripristinato ai 100px base dato che l'immagine a 600px occupa meno altezza */
    }

    /* Uniform section heights on desktop — match titanio block */
    .mac-offer-card,
    .mac-titanio-card,
    .mac-models-card,
    .mac-empresa-card {
        min-height: 495px;
    }

    /* Match offer image to titanio image size */
    .mac-offer-card img {
        max-width: 250px !important;
    }

    /* B5 & B6: 50/50 layout with centered contents — reduce 35% + center
       TO REVERT: replace this block with the comment "B5 & B6 reverted" */
    .mac-product-row {
        padding: 10px 13px;
        border-bottom-width: 13px;
    }

    .mac-product-row:first-child {
        border-top-width: 13px;
    }

    .mac-product-row:last-child {
        border-bottom-width: 13px;
    }

    /* Image: 30% block, centered */
    .mac-product-row img {
        width: 30%;
        flex: 0 0 30%;
        object-position: center;
    }

    /* Info: 50% block, centered content */
    .mac-product-info {
        flex: 0 0 50%;
        padding-left: 0;
        align-items: center;
        text-align: center;
    }

    .mac-product-title {
        font-size: 1rem;
        margin-bottom: 3px;
        text-align: center;
    }

    .mac-rendimiento-label {
        font-size: 0.6rem;
        margin-bottom: 3px;
    }

    .mac-performance-chart {
        max-width: 170px;
        margin-bottom: 5px;
    }

    .mac-perf-segment {
        height: 14px;
    }

    .mac-perf-dot {
        width: 21px;
        height: 21px;
    }

    .mac-features-text {
        font-size: 0.6rem;
        line-height: 1.15;
    }

    .mac-carousel-container {
        min-height: 420px;
        padding: 0 100px;
    }

    .mac-map-container {
        min-height: 495px !important;
        height: 495px !important;
    }
}

/* === ELEMENTOR OVERRIDES === */
.elementor-widget-html {
    padding: 0 !important;
    margin: 0 !important;
}

.elementor-element .elementor-widget-container {
    overflow: visible !important;
}

/* Remove default Elementor internal gaps (gap between sections is handled by margin-bottom on .elementor-section) */
.elementor-section .elementor-container {
    gap: 0 !important;
}

/* Ensure overflow visible propagates through all Elementor wrappers for performance dots */
.elementor-section,
.elementor-container,
.elementor-column,
.elementor-column-wrap,
.elementor-element-populated,
.elementor-widget-wrap,
.elementor-widget,
.elementor-widget-container {
    overflow: visible !important;
}

.elementor-column-gap-default>.elementor-column>.elementor-element-populated {
    padding: 0 !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}