/* ==========================================================================
   HERO
   ========================================================================== */

.cp-hero {
    position: relative;
    min-height: 70vh;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.cp-hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.cp-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 160px;
    background: linear-gradient(180deg, rgba(11,11,14,0) 0%, rgba(11,11,14,0.95) 100%);
    z-index: 2;
    pointer-events: none;
}

.cp-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 60%;
    height: 100%;
    background: rgba(0, 0, 0, 0.50);
    clip-path: polygon(0 0, 100% 0, 70% 100%, 0 100%);
    z-index: 1;
}

.cp-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    width: 50%;
    margin-left: 0;
}

.cp-hero-content .cp-hero-btn {
    vertical-align: center;
}

.cp-hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    color: #fff;
}

.cp-hero-btn {
    display: inline-block;
    background: #ff2d2d;
    color: #fff;
    padding: 12px 28px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}

.cp-hero-btn:hover {
    background: #d81f1f;
    color: #fff;
}

.cp-hero-logo {
    position: absolute;
    right: 18%;
    top: 50%;
    transform: translateY(-50%);
    max-width: 200px;
    width: 18%;
    z-index: 2;
    animation: cp-logo-breathe 3s ease-in-out infinite;
}

@keyframes cp-logo-breathe {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.08);
    }
}

@media (max-width: 768px) {
    .cp-hero {
        min-height: 50vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    .cp-hero-overlay {
        width: 100%;
        clip-path: none;
        background: rgba(0, 0, 0, 0.4);
    }


    .cp-hero-logo {
        display: block;
        position: static;
        transform: none;
        width: 140px;
        max-width: 60%;
        margin-bottom: 24px;
        animation: cp-logo-breathe-mobile 3s ease-in-out infinite;
    }

    .cp-hero-content {
        margin-left: 0;
        text-align: center;
        max-width: 100%;
    }
}

@keyframes cp-logo-breathe-mobile {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}

/* ==========================================================================
   LAYOUT DE LA PORTADA (sin sidebar, ancho completo)
   ========================================================================== */

body.page-template-template-inicio-php .ast-container {
    display: block;
}

/* ==========================================================================
   BANNER WEBPAY + ATENCIONES
   ========================================================================== */

.cp-banner {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: transparent;
    padding: 50px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cp-banner-img {
    max-width: 40%;
    max-height: 150px;
    width: auto;
    height: auto;
    border-radius: 10px;
}

.cp-banner-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.cp-banner-item {
    position: relative;
    isolation: isolate;
    color: #f5f5f5;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    padding: 14px 20px;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.cp-banner-item:hover {
    transform: scale(1.05);
    background-color: #ff2d2d;
    color: #fff;
}

@keyframes cp-neon-flicker {
    0% {
        box-shadow: 0 0 0 rgba(255, 45, 45, 0);
    }
    50% {
        box-shadow: 0 0 6px rgba(255, 45, 45, 0.4);
    }
    100% {
        box-shadow: 0 0 14px rgba(255, 45, 45, 0.8);
    }
}

@media (max-width: 900px) {
    .cp-banner {
        flex-direction: column;
    }

    .cp-banner-img {
        max-width: 90%;
        order: -1;
    }
}

/* ==========================================================================
   CARRUSEL DE PRODUCTOS
   ========================================================================== */

.cp-carousel {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: transparent;
    padding: 60px 20px;
    overflow: hidden;
}

.cp-carousel-track {
    display: flex;
    transition: transform 0.6s ease;
}

.cp-carousel-slide {
    flex: 0 0 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.cp-product-card {
    background: rgba(10, 10, 10, 0.85);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.cp-product-card:hover {
    border-color: #ff2d2d;
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(255, 45, 45, 0.35);
}

.cp-product-card img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s ease;
    -webkit-user-drag: none;
    user-select: none;
}

.cp-product-card:hover img {
    transform: scale(1.1);
}

.cp-product-card h3 {
    color: #fff;
    font-size: 0.9rem;
    margin: 10px 0 5px;
}

.cp-product-price {
    color: #ff2d2d;
    font-weight: 600;
}

@media (max-width: 480px) {
    .cp-carousel-slide {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cp-carousel {
        padding: 30px 20px;
    }

    .cp-product-card {
        box-sizing: border-box;
        width: calc(100% - 16px);
        margin: 0 auto;
        padding: 10px;
        text-align: left;
    }

    .cp-product-card a {
        display: grid;
        grid-template-columns: 90px 1fr;
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 12px;
        padding-block: 6px;
    }

    .cp-product-card img {
        grid-row: 1 / 3;
        grid-column: 1;
        width: 90px;
        height: 90px;
        max-width: none;
        object-fit: contain;
        background: #fff;
        border-radius: 6px;
    }

    .cp-product-card h3 {
        grid-row: 1;
        grid-column: 2;
        margin: 0;
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .cp-product-price {
        grid-row: 2;
        grid-column: 2;
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   CATEGORÍAS
   ========================================================================== */

.cp-categories {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background-color: transparent;
    padding: 40px 20px;
}

.cp-accordion {
    display: flex;
    height: 380px;
    gap: 6px;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
}

.cp-accordion-item {
    position: relative;
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    transition: flex 0.5s cubic-bezier(.2,.9,.3,1), transform 0.3s ease, box-shadow 0.3s ease;
}

.cp-accordion-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11,11,14,0.1) 0%, rgba(11,11,14,0.85) 100%);
}

.cp-accordion-item:hover {
    flex: 4;
    background-size: cover;
    transform: translateY(-10px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,45,45,0.4);
    z-index: 2;
}

.cp-cat-lubricantes {
    background-size: contain !important;
    background-repeat: no-repeat !important;
}

@media (max-width: 700px) {
    .cp-cat-lubricantes {
        background-image: url('https://clubpiston.cl/wp-content/uploads/2026/11/lubricantes-1-e1795529339435.jpeg') !important;
        background-size: cover !important;
    }
}

.cp-cat-lubricantes:hover {
    background-image: url('https://clubpiston.cl/wp-content/uploads/2026/11/lubricantes.jpeg') !important;
    background-size: cover !important;
}

.cp-accordion-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 18px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cp-accordion-bar {
    width: 3px;
    height: 22px;
    background: #ff2d2d;
    border-radius: 2px;
    flex-shrink: 0;
}

.cp-accordion-label span:last-child {
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    transition: all 0.3s ease;
}

.cp-accordion-item:hover .cp-accordion-label span:last-child {
    writing-mode: horizontal-tb;
    transform: none;
}

@media (max-width: 700px) {
    .cp-accordion {
        flex-direction: column;
        height: auto;
    }

    .cp-accordion-item {
        height: 70px;
        flex: none !important;
    }

    .cp-accordion-item:hover {
        height: 200px;
    }

    .cp-accordion-label span:last-child {
        writing-mode: horizontal-tb;
        transform: none;
    }
}

.cp-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.cp-category-item {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.cp-category-item:hover {
    border-color: #ff2d2d;
    transform: scale(1.03);
}

.cp-category-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.cp-category-item:hover img {
    transform: scale(1.1);
}

@media (max-width: 900px) {
    .cp-categories-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
}

@media (max-width: 500px) {
    .cp-categories-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(6, 1fr);
    }
}

/* ==========================================================================
   MARQUESINA DE MARCAS
   ========================================================================== */

.cp-marquee {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background-color: transparent;
    padding: 30px 0;
    overflow: hidden;
}

.cp-marquee::before,
.cp-marquee::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 140px;
    z-index: 2;
    pointer-events: none;
}

.cp-marquee::before {
    left: 0;
    background: linear-gradient(90deg, #0b0b0e 0%, rgba(11,11,14,0) 100%);
}

.cp-marquee::after {
    right: 0;
    background: linear-gradient(270deg, #0b0b0e 0%, rgba(11,11,14,0) 100%);
}

.cp-marquee-track {
    display: flex;
    align-items: center;
    width: max-content;
    animation: cp-marquee-scroll 30s linear infinite;
}

.cp-marquee-item {
    flex: 0 0 240px;
    padding: 0 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cp-marquee-item img {
    width: 110px;
    height: 110px;
    max-width: none;
    object-fit: contain;
    display: block;
    background: #fff;
    border-radius: 50%;
    padding: 18px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cp-marquee-item img:hover {
    transform: scale(1.12);
    box-shadow: 0 0 20px rgba(255, 45, 45, 0.45);
}

@keyframes cp-marquee-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* ==========================================================================
    BORDE ELÉCTRICO (tarjetas envío/compra segura/asesoría/whatsapp)
   ========================================================================== */

.eb-border {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.eb-stroke {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid #ff2d2d;
    filter: url(#eb-glow);
    opacity: 0.9;
}

.eb-glow1 {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    border: 1px solid #ff2d2d;
    filter: blur(2px);
    opacity: 0.4;
}

.eb-glow2 {
    display: none;
}

.eb-spark-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.eb-spark-path {
    fill: none;
    stroke: url(#eb-spark-gradient);
    stroke-width: 3;
    stroke-linecap: round;
    filter: url(#eb-glow);
}
