/* ============================================================
   producto.css
   ============================================================ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    background: #f5f7fa;
    color: #222;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* ── Aviso pago contraentrega ── */
.aviso-contraentrega {
    background: #ff4d00;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    text-align: center;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.3;
    padding: 9px 14px;
}

.aviso-contraentrega .aviso-icono {
    font-size: 1rem;
    line-height: 1;
}

/* ── Header ── */
header {
    background: #111;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    transition: padding .3s ease;
}

.logo-link { text-decoration: none; }
.logo { color: #ff4d00; font-size: 1.6rem; }

.nav-links-wrap { display: flex; align-items: center; }

@media (min-width: 769px) {
    .nav-links-wrap { gap: 20px; }
}

nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    transition: .3s;
}

nav a:hover { color: #ff4d00; }

/* ── Carrito badge ── */
.nav-carrito {
    position: relative;
    font-size: 1.2rem;
    line-height: 1;
    top: 4px;
}

.carrito-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ff4d00;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
}

/* ── Menú hamburguesa (oculto en escritorio) ── */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* ── Botones globales ── */
.btn {
    background: rgba(255,77,0,.9);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
    transition: .3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #e03d00;
    transform: translateY(-2px);
}

.btn-secundario {
    background: transparent;
    color: #555;
    border: 1.5px solid #ddd;
    box-shadow: none;
}

.btn-secundario:hover {
    background: #f0f0f0;
    color: #111;
    transform: translateY(-2px);
}

/* ── Wrapper de página ── */
.page-wrapper { padding: 5px 0 80px; }

/* ── Breadcrumb ── */
.breadcrumb {
    padding: 8px 0 16px; /* antes: 16px 0 24px */
    font-size: 13px;
    color: #888;
}

.breadcrumb a {
    color: #ff4d00;
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

/* ── Layout producto ── */
.producto-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
    margin-bottom: 32px;
}

.imagen-col {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.producto-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;              /* en vez de visible, para que la galería no se salga del marco */
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
    border: 2px solid #e0e0e0;     /* marco más marcado */
    position: relative;
}

/* Cuando el media principal es un video, sin ningún borde */
.producto-card.video-activo {
    border: none;
}

.producto-card img.media-principal,
.producto-card video.media-principal {
    width: 100%;
    height: 380px;
    object-fit: contain;
    display: block;
    transition: transform .4s ease;
    position: relative;
    z-index: 0;
    background: white;
}

.producto-card img.media-principal {
    padding: 32px;
}

.producto-card video.media-principal {
    padding: 8px 12px 32px;
}

.producto-card:hover img.media-principal { transform: scale(1.04); }

.badge-cat {
    position: absolute;
    top: 16px;
    left: 16px;
    background: #ff4d00;
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    z-index: 1;
}

/* ── Galería ── */
.galeria {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 12px 16px 16px;
    background: white;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    /* ya no necesita border propio, hereda el marco de .producto-card */
}

.galeria-item {
    flex: 0 0 90px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ddd;   /* antes: transparente — ahora siempre visible */
    cursor: pointer;
    transition: border-color .2s, transform .2s;
    scroll-snap-align: start;
    position: relative; /* necesario para posicionar el ícono de play */
}

.galeria-item:hover {
    transform: translateY(-2px);
    border-color: #ff4d00;   /* un poco más definido en hover */
}

.galeria-item.activa {
    border-color: #ff4d00;
}

.galeria-item img {
    width: 100%;
    height: 90px;
    object-fit: contain;
    padding: 6px;
    background: white;
    display: block;
}

/* Ícono de play sobre la miniatura del video */
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,.55);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    pointer-events: none;
}

/* ── Card descripción ── */
.descripcion {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.descripcion h1 {
    font-size: clamp(20px, 2.4vw, 27px);
    font-weight: 700;
    line-height: 1.2;
    color: #111;
}

.precio-bloque {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.precio-valor {
    font-size: 30px;
    font-weight: 700;
    color: #ff4d00;
}

.precio-moneda {
    font-size: 13px;
    color: #999;
}

/* ── Descripción con "Ver más" ── */
.desc-wrap {
    position: relative;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.texto-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.75;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.texto-desc.expandido {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.ver-mas-btn {
    display: none;
    position: absolute;
    right: 0;
    bottom: 0;
    padding-left: 32px;
    background: linear-gradient(to right, rgba(255,255,255,0), #fff 40%);
    color: #ff4d00;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.75;
    cursor: pointer;
}

.ver-mas-btn.btn-fijo {
    position: static;
    display: inline-block;
    background: none;
    padding-left: 0;
    margin-top: 4px;
}

.ver-mas-btn:hover { text-decoration: underline; }

/* ── Selector cantidad ── */
.cantidad-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.cantidad-selector button {
    width: 34px;
    height: 34px;
    border: 1.5px solid #ddd;
    background: #f5f7fa;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 700;
    transition: all .2s;
}

.cantidad-selector button:hover {
    background: #ff4d00;
    color: white;
    border-color: #ff4d00;
}

.cantidad-selector input {
    width: 50px;
    text-align: center;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    padding: 6px;
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    background: white;
}

.stock-info {
    font-size: .8rem;
    color: #999;
    margin-left: 4px;
}

/* ── Botones del detalle ── */
.detalle-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.btn-comprar-ahora {
    background: #ff4d00;
    font-size: 16px;
    font-weight: 700;
    padding: 15px 20px;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(255,77,0,.35);
}

.btn-comprar-ahora:hover {
    background: #e64500;
    transform: translateY(-2px);
}

.btn-carrito-detalle {
    font-size: 15px;
    padding: 13px 20px;
    border-radius: 999px;
}

/* ── Fila: Agregar al carrito + Volver al catálogo en una sola línea ── */
.detalle-buttons-fila {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
}

.detalle-buttons-fila .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 12px;
    padding-right: 12px;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .detalle-buttons-fila .btn {
        font-size: 13px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

@media (max-width: 360px) {
    .detalle-buttons-fila {
        flex-wrap: wrap;
    }

    .detalle-buttons-fila .btn {
        flex: 1 1 100%;
    }
}

/* ── Divisores de sección ── */
.section-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.section-divider h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
}

.section-divider span { color: #ff4d00; }

.section-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ddd;
}

/* ── Grid de cards ── */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 56px;
}

.card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,.1);
    transition: .3s;
    cursor: pointer;
}

.card:hover { transform: translateY(-8px); }

.card img {
    width: 100%;
    height: 220px;
    object-fit: contain;
    padding: 10px;
    background: white;
}

.card-body { padding: 18px 20px 20px; }

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-price {
    color: #ff4d00;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 14px;
}

.card-buttons { display: flex; gap: 8px; }

.card-buttons button {
    flex: 1;
    border: none;
    background: #111;
    color: white;
    padding: 11px 8px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    transition: background .2s;
}

.card-buttons button:hover { background: #ff4d00; }
.card-buttons button.btn-carrito { background: #ff4d00; }
.card-buttons button.btn-carrito:hover { background: #e03d00; }
.card-buttons button:disabled { background: #ccc; cursor: not-allowed; }

/* ── Secciones similares / resto ── */
.similares-section { margin-bottom: 60px; }
.resto-section { margin-bottom: 40px; }

/* ── Paginación ── */
.paginacion-seccion {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: -30px 0 50px;
}

.paginacion-seccion button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    transition: .2s;
}

.paginacion-seccion button:hover { border-color: #ff4d00; color: #ff4d00; }
.paginacion-seccion button.active { background: #ff4d00; color: white; border-color: #ff4d00; }

/* ── Toast ── */
#toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #ff4d00;
    color: white;
    padding: .7rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: .9rem;
    opacity: 0;
    transition: all .3s;
    pointer-events: none;
    z-index: 999;
    white-space: nowrap;
}

#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    font-size: 16px;
    color: #888;
}

/* ── Footer ── */
footer {
    background: #111;
    color: white;
    text-align: center;
    padding: 30px 20px 20px;
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.social-icons { display: flex; gap: 28px; align-items: center; }

.social-icons a {
    color: #ffffff;
    transition: color .3s, transform .2s;
    display: flex;
    align-items: center;
}

.social-icons a:hover { color: #ff4d00; transform: translateY(-3px); }

footer p { color: #aaa; font-size: 13px; }
footer strong { color: #ff4d00; }

/* ── Responsive ── */
@media (max-width: 768px) {

    .aviso-contraentrega {
        font-size: .7rem;
        padding: 7px 10px;
        gap: 6px;
    }

    .aviso-contraentrega .aviso-icono {
        font-size: .85rem;
    }

    /* Nav: logo izq | hamburguesa der */
    .nav {
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        padding: 12px 0;
        gap: 14px;
        position: relative;
    }

    .logo {
        font-size: 1.3rem;
    }

    .menu-toggle { display: block; }

    .nav-links-wrap { margin-left: auto; }
    .nav-principal { gap: 14px; }
    .nav-principal a { margin-left: 0; font-size: 0.85rem; }

    header nav.nav-secundaria {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #111;
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 20px 20px;
        gap: 14px;
        border-top: 1px solid #333;
        z-index: 200;
    }

    header nav.nav-secundaria.open { display: flex; }

    /* Producto */
    .producto-layout { grid-template-columns: 1fr; margin-bottom: 20px; }
    .producto-card img.media-principal {
        height: 280px;
        aspect-ratio: unset;
        object-fit: contain;
        padding: 16px;
    }
    .producto-card video.media-principal {
        height: 280px;
        aspect-ratio: unset;
        object-fit: cover;
        padding: 0;
    }
    .descripcion { padding: 24px 20px; gap: 16px; }
    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .galeria-item { flex: 0 0 100px; }
    .galeria-item img { height: 100px; }

}

@media (max-width: 480px) {
    .productos-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card img { height: 150px; }
    .card-body { padding: 12px 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; }
}

.nav-derecha {
    display: flex;
    align-items: center;
    gap: 16px;
}


header.scrolled .nav {
    padding: 8px 0;
}

header.scrolled .logo {
    font-size: 1.4rem;
    transition: font-size .3s ease;
}