/* Estilos propios de COMMERCE.SITE. Los colores provienen del tema Bootswatch activo. */

/* Barra superior de mensajes */
.topbar { padding: .35rem 0; }
.topbar a { color: inherit; text-decoration: underline; }
.topbar .carousel-item { transition-duration: .6s; }

/* Cabecera */
.brand-logo { max-height: 96px; max-width: 100%; width: auto; display: block; }
.site-header { padding-top: .6rem; padding-bottom: .6rem; }
.site-header .brand { vertical-align: top; }
.brand-text-beside { font-size: 1.15rem; margin: .2rem 0 .2rem .65rem; flex: 1 1 7rem; min-width: 0; }
.brand-text { font-weight: 800; font-size: 1.6rem; line-height: 1.1; letter-spacing: -.02em; }
/* Buscador, lupa y "Descargar comprobante" comparten el mismo alto en cualquier tema. */
:root { --search-height: 2.75rem; }
.search-form .form-control { height: var(--search-height); border-right: 0; }
.search-form .btn { font-size: 1.1rem; height: var(--search-height); }
.btn-receipt {
    display: inline-flex; align-items: center; justify-content: center;
    height: var(--search-height); margin-left: .5rem; padding-top: 0; padding-bottom: 0;
}
/* En celulares pasa a una línea propia, a todo el ancho, para no achicar el buscador. */
@media (max-width: 575.98px) {
    .btn-receipt { width: 100%; margin-left: 0; margin-top: .5rem; }
}
.header-contact .btn { white-space: nowrap; }

/* Menú principal */
.site-nav { padding-top: .25rem; padding-bottom: .25rem; }
.site-nav .nav-link { font-weight: 500; }
.site-nav .dropdown-menu { max-height: 70vh; overflow-y: auto; }

/* Carrusel de portada */
.home-carousel .banner-img { object-fit: cover; height: 440px; }
.home-carousel .carousel-caption {
    left: 8%; right: auto; bottom: 18%; max-width: 560px;
    background: rgba(0, 0, 0, .45); border-radius: .5rem; padding: 1.25rem 1.5rem;
}
.banner-title { font-weight: 800; font-size: 2.2rem; }
.banner-subtitle { font-size: 1.15rem; }
@media (max-width: 991.98px) { .home-carousel .banner-img { height: 320px; } .banner-title { font-size: 1.6rem; } }
@media (max-width: 767.98px) {
    .home-carousel .banner-img { height: 230px; }
    .home-carousel .has-mobile .banner-img { height: auto; max-height: 520px; }
    .home-carousel .carousel-caption { left: 5%; right: 5%; bottom: 2.2rem; padding: .6rem .8rem; }
    .banner-title { font-size: 1.15rem; margin-bottom: .25rem; }
    .banner-subtitle { font-size: .85rem; }
    .home-carousel .carousel-caption .btn { padding: .25rem .6rem; font-size: .85rem; }
}
.hero-default { background: linear-gradient(135deg, rgba(0,0,0,.03), rgba(0,0,0,.08)); }

/* Títulos de sección */
.section-title { font-weight: 800; font-size: 1.5rem; margin-bottom: 1.25rem; position: relative; }
.section-head .section-title::after, .section-title::after {
    content: ""; display: block; width: 48px; height: 4px; margin-top: .4rem;
    background: var(--primary); border-radius: 2px;
}

/* Categorías */
.category-tile:hover { text-decoration: none; }
.category-circle {
    display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
    width: 96px; height: 96px; border-radius: 50%;
    background: rgba(0, 0, 0, .05); color: var(--primary); font-size: 2.4rem;
    border: 2px solid transparent; transition: transform .2s, border-color .2s;
}
.category-circle img { width: 100%; height: 100%; object-fit: cover; }
.category-tile:hover .category-circle { transform: translateY(-4px); border-color: var(--primary); }
.category-name { font-weight: 600; font-size: .9rem; line-height: 1.2; }
@media (max-width: 575.98px) { .category-circle { width: 72px; height: 72px; font-size: 1.8rem; } .category-name { font-size: .8rem; } }

/* Tarjetas de producto */
.product-card { position: relative; transition: box-shadow .2s, transform .2s; }
.product-card:hover { box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .12) !important; transform: translateY(-2px); }
.product-img-wrap { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #fff; border-radius: inherit; }
.product-img-wrap img { width: 100%; height: 100%; object-fit: contain; padding: .75rem; transition: transform .25s; }
.product-card:hover .product-img-wrap img { transform: scale(1.05); }
.product-name {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; min-height: 2.5em; line-height: 1.25;
}
.product-brand { font-size: .7rem; letter-spacing: .04em; }
.badge-offer { position: absolute; top: .6rem; left: .6rem; z-index: 2; font-size: .85rem; }
.price-old { text-decoration: line-through; }

/* Detalle de producto */
.product-gallery .carousel-item { aspect-ratio: 1 / 1; background: #fff; }
.product-gallery .carousel-item img { width: 100%; height: 100%; object-fit: contain; padding: 1rem; }
.product-gallery .carousel-control-prev-icon,
.product-gallery .carousel-control-next-icon { background-color: rgba(0, 0, 0, .45); border-radius: 50%; padding: 1.1rem; background-size: 50%; }
.gallery-thumbs img { width: 72px; height: 72px; object-fit: contain; background: #fff; cursor: pointer; margin: 0 .5rem .5rem 0; padding: 2px; border-width: 2px !important; }
.gallery-thumbs img.active { border-color: var(--primary) !important; }

/* Visor de la imagen del producto (assets/js/product-zoom.js) */
.product-gallery { position: relative; }
.product-gallery .carousel-item a { display: block; height: 100%; cursor: zoom-in; }
.gallery-zoom-btn { position: absolute; top: .6rem; right: .6rem; z-index: 5; border: 0; border-radius: 2rem; padding: .35rem .8rem; background: rgba(0, 0, 0, .6); color: #fff; font-size: .85rem; line-height: 1.4; cursor: pointer; }
.gallery-zoom-btn:hover, .gallery-zoom-btn:focus { background: rgba(0, 0, 0, .8); outline: 0; box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .45); }
html.img-zoom-lock { overflow: hidden; }
.img-zoom { position: fixed; inset: 0; z-index: 2000; display: none; flex-direction: column; background: rgba(0, 0, 0, .94); color: #fff; }
.img-zoom.open { display: flex; }
.img-zoom-bar { position: relative; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; flex: 0 0 auto; }
.img-zoom-counter { font-size: .9rem; opacity: .85; }
.img-zoom-tools { display: flex; gap: .4rem; margin-left: auto; }
.img-zoom button { border: 0; color: #fff; background: rgba(255, 255, 255, .16); border-radius: 50%; width: 2.5rem; height: 2.5rem; font-size: 1.1rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.img-zoom button:hover, .img-zoom button:focus { background: rgba(255, 255, 255, .32); outline: 0; box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .45); }
.img-zoom-stage { position: relative; z-index: 1; isolation: isolate; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; cursor: zoom-in; user-select: none; }
.img-zoom-stage.zoomed { cursor: grab; }
.img-zoom-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; transform-origin: center center; will-change: transform; -webkit-user-drag: none; }
.img-zoom-nav { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); width: 3rem !important; height: 3rem !important; font-size: 1.4rem !important; }
.img-zoom-prev { left: .8rem; } .img-zoom-next { right: .8rem; }
.img-zoom-hint { position: absolute; left: 0; right: 0; bottom: .8rem; text-align: center; font-size: .8rem; opacity: 0; pointer-events: none; }
.img-zoom.open .img-zoom-hint { animation: img-zoom-hint 4.5s ease .4s both; }
@keyframes img-zoom-hint { 0%, 100% { opacity: 0; } 15%, 80% { opacity: .85; } }
@media (max-width: 575.98px) { .img-zoom-hint { display: none; } .img-zoom-nav { width: 2.5rem !important; height: 2.5rem !important; } }
.product-price-box { background: rgba(0, 0, 0, .04); }
.product-description { line-height: 1.7; }

/* Pie de página */
.site-footer a { color: inherit; opacity: .85; }
.site-footer a:hover { opacity: 1; }
.site-footer li { margin-bottom: .35rem; }
.footer-muted { opacity: .75; }
.footer-hr { border-color: currentColor; opacity: .2; }
.footer-contact i { width: 1.2rem; display: inline-block; }
.social-links a { font-size: 1.4rem; margin-right: .75rem; }

/* Botón flotante de WhatsApp */
.whatsapp-float {
    position: fixed; right: 20px; bottom: 20px; z-index: 1030;
    width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #25d366; color: #fff !important; font-size: 30px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .3); transition: transform .2s;
}
.whatsapp-float:hover { transform: scale(1.08); text-decoration: none; }

/* Pedidos: carrito y checkout (solo visibles si Pedidos está activado) */
/* Mismo alto que el buscador, la lupa y "Descargar comprobante" (variable --search-height). */
.cart-btn, .header-login, .header-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: var(--search-height); padding-top: 0; padding-bottom: 0; vertical-align: middle;
}
/* En botones flex el espacio inicial del texto se pierde: se separa el ícono con margen. */
.btn-label { margin-left: .4rem; }
.cart-btn .badge { margin-left: .35rem; }
.header-login, .header-btn { margin-left: .25rem; }
.qty-input { width: 80px; }
.cart-thumb { width: 64px; height: 64px; object-fit: contain; background: #fff; }
.cart-table td { vertical-align: middle; }
.step {
    display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem;
    border-radius: 50%; background: var(--primary); color: #fff; font-size: .85rem; margin-right: .4rem;
}
.ship-map { height: 340px; width: 100%; z-index: 0; }
.map-search { max-width: 420px; flex: 1 1 260px; }
.payment-option { cursor: pointer; }
.checkout-summary { position: sticky; top: 1rem; }
.yape-qr { width: 200px; height: 200px; object-fit: contain; background: #fff; }
.transfer-details { white-space: normal; line-height: 1.7; }
.shop-toast {
    position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); z-index: 1060;
    max-width: 92vw; margin: 0; opacity: 0; transition: transform .25s, opacity .25s;
}
.shop-toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Pie: dirección fiscal y establecimientos (el texto largo se alinea a la derecha del ícono) */
.footer-address { display: flex; align-items: flex-start; gap: .45rem; }
.footer-address i { flex-shrink: 0; margin-top: .15rem; }
.footer-establishment strong { font-size: .95rem; }

/* Portada: empresas que confían en nosotros (logos sobre fichas blancas para que se vean con cualquier tema) */
.trusted-logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1rem; }
.trusted-logo { display: flex; align-items: center; justify-content: center; width: 170px; height: 90px; padding: .75rem 1rem; background: #fff; border: 1px solid rgba(0,0,0,.08); border-radius: .5rem; }
.trusted-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
@media (max-width: 575.98px) { .trusted-logo { width: calc(50% - .5rem); height: 80px; } }
.trusted-companies .section-title::after { margin-left: auto; margin-right: auto; }
