html,
body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

footer {
    background: #1e293b;
    color: #94a3b8;
}

.cart-icon {
    position: relative;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    font-size: .6rem;
    line-height: 1;
    min-width: 1.25em;
    padding: .3em .45em;
}

.cart-badge[hidden] {
    display: none;
}

.product-card {
    transition: box-shadow .2s;
}

.product-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
}

.card-img-wrapper {
    position: relative;
}

.product-card {
   height: 100%;
}

.product-img {
    height: 200px;
    object-fit: contain;
    padding: 1rem;
}

.product-image-link {
    display: block;
    cursor: pointer;
    text-decoration: none;
    overflow: hidden;
}

.product-image-link img,
.product-image-link .product-img {
    transition: transform .25s ease;
}

.product-image-link:hover img,
.product-image-link:hover .product-img {
    transform: scale(1.04);
}

.discount-badge {
    position: absolute;
    top: 8px;
    right: 8px;
}

.qty-stepper {
    width: fit-content;
}

.qty-stepper .qty-input {
    width: 48px;
    flex: none;
    text-align: center;
}

/* ── Menú de Cuenta (dropdown del header) ─────────────── */
.account-menu {
    min-width: 300px;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.account-menu .dropdown-item {
    white-space: normal;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
}

.account-menu .dropdown-item:hover {
    background-color: #f8f9fa;
}

.account-menu .dropdown-divider {
    margin: 0.25rem 0 0.5rem;
    border-top: 1px solid #dee2e6;
}

.account-menu .btn {
    white-space: nowrap;
    --bs-btn-padding-x: 1rem;
}

.account-menu-header {
    padding: 0.75rem 1rem 0.875rem;
}

.account-menu-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #212529;
}

.account-menu-subtitle {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: #6c757d;
}

.account-menu-desc {
    padding-left: 1.5rem;
}

/* ── Iconos de acción del header (carrito / cuenta) ────── */
.navbar-dark .nav-link.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.navbar-dark .nav-link.nav-icon:hover {
    color: #fff;
}

.navbar-dark .nav-link.nav-icon .bi {
    font-size: 1.4rem;
    line-height: 1;
}

/* ── Barra de navegación inferior (móvil) ──────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: #212529;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.bottom-nav-inner {
    display: flex;
    align-items: stretch;
}

.bottom-nav-item {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    min-height: 3.75rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    text-decoration: none;
}

.bottom-nav-item:hover,
.bottom-nav-item:focus-visible,
.bottom-nav-item.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

.bottom-nav-item .bi,
.bottom-nav-link .bi {
    font-size: 1.3rem;
    line-height: 1;
}

.bottom-nav-item > span,
.bottom-nav-link span {
    font-size: 0.72rem;
    line-height: 1.1;
}

.bottom-nav-dropdown {
    position: relative;
}

.bottom-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: inherit;
    text-decoration: none;
    width: 100%;
    height: 100%;
}

.bottom-nav-item[data-catalog-categories-toggle] {
    appearance: none;
    background: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.bottom-nav-item[data-catalog-categories-toggle]:hover,
.bottom-nav-item[data-catalog-categories-toggle]:focus-visible {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 991.98px) {
    body {
        padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
    }

    .navbar > .container,
    .navbar > .container-fluid {
        flex-wrap: nowrap;
    }

    .navbar-brand {
        white-space: nowrap;
    }

    .navbar-brand img {
        max-width: 96px !important;
        width: auto !important;
        height: 32px !important;
        object-fit: contain !important;
    }
}
