:root {
    --tienda-verde: #65a135;
    --tienda-verde-claro: #e5f2df;
    --tienda-verde-oscuro: #328b38;
    --tienda-azul: #0a1a3a;
}

.tienda-body {
    background: #eef0ee;
}

.tienda-header {
    background: var(--tienda-verde-claro);
    border-bottom: 1px solid #d7e8cd;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.tienda-cart-link {
    color: #fff;
}

.tienda-menu-nav {
    background: #000;
}

.tienda-menu-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #fff;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 400;
    letter-spacing: .2px;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}

.tienda-menu-btn:hover,
.tienda-menu-btn:focus {
    background: var(--tienda-verde-oscuro);
    color: #fff;
}

.tienda-menu-btn.active {
    background: var(--tienda-verde-oscuro);
    color: #fff;
}

/* En pantallas con mouse, los submenús del menú (Categorías, Supermercado) se abren al
   pasar por encima, sin esperar el click — en touch se deja el comportamiento normal de
   Bootstrap (tocar para abrir), porque ahí no existe un "hover" real. */
@media (hover: hover) {
    .tienda-menu-nav .dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

/* Botones "fantasma": transparentes, sin borde, texto oscuro y delicado (fila superior clara) */
.tienda-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: #1a1a1a;
    text-decoration: none;
    font-size: .85rem;
    font-weight: 400;
    white-space: nowrap;
    transition: background .2s ease, color .2s ease;
}

.tienda-btn-ghost:hover,
.tienda-btn-ghost:focus {
    background: rgba(0,0,0,.06);
    color: #000;
}

/* Fila superior del header: logo a la izquierda, botones a la derecha y el buscador
   siempre matemáticamente centrado en el medio — con grid de columnas 1fr/auto/1fr
   el buscador queda centrado sin importar si el logo y los botones miden distinto. */
.tienda-header-top {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.tienda-header-top > .tienda-logo {
    justify-self: start;
}

.tienda-header-top > .d-flex {
    justify-self: end;
}

@media (max-width: 767.98px) {
    .tienda-header-top {
        grid-template-columns: auto auto;
        row-gap: 8px;
    }
    .tienda-buscador-wrap {
        grid-column: 1 / -1;
        order: 3;
        max-width: none;
    }
}

.tienda-buscador-wrap {
    position: relative;
    justify-self: center;
    width: 100%;
    max-width: 480px;
}

.tienda-buscador-form {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--tienda-verde);
    border-radius: 999px;
    padding: 4px 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.tienda-buscador-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    padding: 10px 4px;
}

/* Sugerencias de autocompletar, ancladas al buscador */
.tienda-sugerencias {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d7e8cd;
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
    max-height: 360px;
    overflow-y: auto;
    z-index: 1030;
}

.tienda-sugerencias.mostrar {
    display: block;
}

.tienda-sugerencia-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    text-decoration: none;
    color: #1a1a1a;
    border-bottom: 1px solid #f1f1f1;
}

.tienda-sugerencia-item:last-child {
    border-bottom: none;
}

.tienda-sugerencia-item:hover,
.tienda-sugerencia-item.activa {
    background: var(--tienda-verde-claro);
}

.tienda-sugerencia-item img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    flex: 0 0 auto;
    background: #f1f1f1;
}

.tienda-sugerencia-nombre {
    flex: 1 1 auto;
    font-size: .88rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tienda-sugerencia-precio {
    font-size: .85rem;
    color: #555;
    white-space: nowrap;
    flex: 0 0 auto;
}

.tienda-sugerencia-vertodos {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--tienda-verde-oscuro);
    text-decoration: none;
}

.tienda-sugerencia-vertodos:hover {
    background: var(--tienda-verde-claro);
}

.tienda-producto-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform .15s, box-shadow .15s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tienda-producto-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,.10);
}

.tienda-producto-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #f0f2f7;
}

.tienda-producto-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tienda-producto-nombre {
    font-size: .95rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    margin-bottom: 4px;
    min-height: 2.4em;
}

.tienda-producto-proveedor {
    font-size: .75rem;
    color: #888;
    margin-bottom: 8px;
}

.tienda-producto-precio {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--tienda-azul);
    margin-top: auto;
}

.tienda-producto-destacado {
    position: relative;
}

.tienda-badge-destacado {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--tienda-verde);
    color: #fff;
    font-size: .7rem;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 2;
}

.tienda-dev-banner {
    background: #fff3cd !important;
}

.tienda-calesita-wrap {
    width: 100%;
    margin: 12px auto 20px;
}

.tienda-calesita-carousel .carousel-inner {
    overflow: hidden;
    border-radius: .8rem;
}

.tienda-calesita-img {
    height: 220px;
    object-fit: cover;
}

.tienda-calesita-caption {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px;
    background: rgba(0,0,0,.35);
    text-align: center;
}

.tienda-calesita-caption h3 {
    color: #fff;
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.tienda-calesita-caption .btn {
    padding: 6px 18px;
    font-size: .9rem;
}

.tienda-calesita-carousel .carousel-indicators {
    margin-bottom: 0;
}

.tienda-calesita-carousel .carousel-control-prev,
.tienda-calesita-carousel .carousel-control-next {
    width: 8%;
}

@media (max-width: 768px) {
    .tienda-calesita-img {
        height: 170px;
    }
    .tienda-calesita-caption h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .tienda-producto-nombre { font-size: .85rem; }
    .tienda-producto-precio { font-size: 1rem; }
}

.tienda-breadcrumb {
    display: inline-flex;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e2e6ee;
    border-radius: 999px;
    padding: 8px 18px;
    margin-bottom: 0;
    font-size: .82rem;
}

.tienda-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "\203A";
    color: #b7bcc7;
    font-weight: 700;
}

.tienda-breadcrumb .breadcrumb-item a {
    color: var(--tienda-verde);
    text-decoration: none;
    font-weight: 500;
}

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

.tienda-breadcrumb .breadcrumb-item.active {
    color: #6c7280;
}

#btn-agregar-carrito {
    width: auto;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.tienda-producto-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tienda-azul);
    margin-top: 10px;
}

/* Vitrina de proveedores (proveedores.php) — listado vertical, mismo espíritu que el
   submenú "Supermercado" del header, pero con más aire y una miniatura por proveedor. */
.tienda-proveedor-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tienda-proveedor-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    transition: transform .12s, box-shadow .12s, background .12s;
    text-decoration: none;
    color: inherit;
}

.tienda-proveedor-item:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
    background: var(--tienda-verde-claro);
    color: inherit;
}

.tienda-proveedor-logo-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--tienda-verde-claro);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.tienda-proveedor-logo {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.tienda-proveedor-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--tienda-verde), var(--tienda-verde-oscuro));
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
}

.tienda-proveedor-nombre {
    font-weight: 600;
    font-size: .95rem;
    color: #1a1a1a;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tienda-proveedor-rubro {
    font-size: .75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tienda-proveedor-badge {
    font-size: .72rem;
    color: var(--tienda-verde-oscuro);
    background: var(--tienda-verde-claro);
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.tienda-proveedor-item:hover .tienda-proveedor-badge {
    background: #fff;
}

.tienda-proveedor-chevron {
    color: #b8bfc9;
    flex-shrink: 0;
}
