/* =============================================
   D LIFE Ecommerce — Tema AMZ Marketplace Style
   Totalmente personalizable con la Paleta de Colores
   ============================================= */

body.theme-amz {
    --amz-dark:       var(--secondary, #131921);
    --amz-subnav:     var(--footer-bg, #232F3E);
    --amz-accent:     var(--accent, var(--primary, #FF9900));
    --amz-btn:        var(--buttons, #FFD814);
    --amz-btn-hover:  var(--buttons-hover, var(--buttons_hover, #F7CA00));
    --amz-bg:         var(--background, #EAEDED);
    --surface:        #ffffff;
    --text-main:      var(--text, #0F1111);
    --text-muted:     #565959;
    --border:         #D5D9D9;
    --radius:         4px;
    --radius-sm:      3px;
    --shadow-sm:      0 2px 5px 0 rgba(213,217,217,.5);
    --shadow-md:      0 4px 12px rgba(0,0,0,.12);
    --shadow-lg:      0 6px 20px rgba(0,0,0,.15);
    background-color: var(--amz-bg) !important;
    color: var(--text-main);
}

/* ==================== TOPBAR & HEADER ==================== */
body.theme-amz .topbar {
    background: var(--amz-dark) !important;
    color: rgba(255,255,255,0.9);
    font-size: 0.78rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
body.theme-amz .topbar a { color: rgba(255,255,255,0.9); }
body.theme-amz .topbar a:hover { color: var(--amz-accent); }

body.theme-amz .site-header {
    background: var(--amz-dark) !important;
    border-bottom: none !important;
    box-shadow: none !important;
    position: sticky; top: 0; z-index: 1000;
}
body.theme-amz .site-header .navbar-brand .brand-name,
body.theme-amz .site-header .brand-text-logo {
    color: #ffffff !important;
    font-weight: 800;
    letter-spacing: 0.5px;
}
body.theme-amz .site-header .brand-tagline { color: rgba(255,255,255,0.6) !important; }
body.theme-amz .site-header .navbar-brand img {
    filter: none !important;
    max-height: 44px;
    object-fit: contain;
}

/* Buscador estilo AMZ con botón adaptable a la paleta */
body.theme-amz .search-form {
    flex: 1 1 350px;
    max-width: 850px;
    margin: 0 18px;
}
body.theme-amz .search-form .input-group {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
body.theme-amz .search-form .form-control,
body.theme-amz .search-form .search-input {
    border: none !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #0F1111 !important;
    font-size: 0.92rem;
    padding: 9px 14px;
    box-shadow: none !important;
}
body.theme-amz .search-form .form-control:focus {
    box-shadow: 0 0 0 2px var(--amz-accent) !important;
}
body.theme-amz .search-btn {
    background: var(--amz-accent, #febd69) !important;
    color: #131921 !important;
    border: none !important;
    border-radius: 0 4px 4px 0 !important;
    padding: 8px 20px !important;
    font-size: 1.15rem;
    transition: background 0.15s ease;
}
body.theme-amz .search-btn:hover {
    background: var(--amz-btn-hover, #f3a847) !important;
    opacity: 0.9;
}

/* Nav Links y Botones Header */
body.theme-amz .navbar .nav-link {
    color: rgba(255,255,255,0.92) !important;
    font-size: 0.85rem;
    padding: 6px 10px !important;
    border-radius: 2px;
}
body.theme-amz .navbar .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,0.1) !important;
}

/* Acciones de usuario y carrito */
body.theme-amz .amz-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-shrink: 0;
}
body.theme-amz .amz-nav-item {
    color: #ffffff !important;
    text-decoration: none;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
    transition: border-color 0.15s;
    cursor: pointer;
    background: transparent;
}
body.theme-amz .amz-nav-item:hover {
    border-color: rgba(255,255,255,0.6);
}
body.theme-amz .amz-nav-line1 {
    font-size: 0.7rem;
    color: #cccccc;
    white-space: nowrap;
}
body.theme-amz .amz-nav-line2 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
}

/* Barra de navegación secundaria */
body.theme-amz .amz-nav-bar {
    background: var(--amz-subnav) !important;
    padding: 0;
    display: flex;
    align-items: center;
    overflow-x: auto;
    scrollbar-width: none;
}
body.theme-amz .amz-nav-bar::-webkit-scrollbar { display: none; }
body.theme-amz .amz-nav-bar a {
    color: rgba(255,255,255,0.92);
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 9px 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}
body.theme-amz .amz-nav-bar a:hover {
    color: #ffffff;
    border-color: rgba(255,255,255,0.6);
    border-radius: 2px;
}
body.theme-amz .amz-nav-bar a.all-menu {
    font-weight: 700;
    padding-left: 16px;
    padding-right: 16px;
}

/* ==================== HERO SLIDER ==================== */
body.theme-amz .amz-hero-slider {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: var(--amz-subnav);
}
body.theme-amz .amz-hero-slider .carousel-item {
    height: 520px;
}
body.theme-amz .amz-hero-slider .carousel-item img {
    width: 100%;
    height: 520px;
    object-fit: cover;
    object-position: center top;
}
body.theme-amz .amz-hero-slider .carousel-item-default {
    height: 520px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 8%;
}

/* Caption flotante sobre banner */
body.theme-amz .amz-hero-slider .carousel-caption {
    position: absolute;
    top: 50px;
    left: 8%;
    bottom: auto;
    right: auto;
    max-width: 700px;
    padding: 0;
    text-align: left;
    z-index: 4;
}
body.theme-amz .amz-hero-slider .carousel-caption .caption-content {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}
body.theme-amz .amz-hero-slider .carousel-caption h1 {
    color: #ffffff;
    font-weight: 800;
    line-height: 1.18;
    margin-bottom: 10px;
}
body.theme-amz .amz-hero-slider .carousel-caption p {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    line-height: 1.45;
}

/* Gradiente inferior que funde el slider con el fondo */
body.theme-amz .amz-hero-slider::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 250px;
    background: linear-gradient(to bottom, rgba(234,237,237,0) 0%, rgba(234,237,237,0.7) 60%, var(--amz-bg) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Flechas del Slider */
body.theme-amz .amz-hero-slider .carousel-control-prev,
body.theme-amz .amz-hero-slider .carousel-control-next {
    width: 60px;
    height: 260px;
    top: 20px;
    opacity: 0.8;
    z-index: 5;
}
body.theme-amz .amz-hero-slider .carousel-control-prev:hover,
body.theme-amz .amz-hero-slider .carousel-control-next:hover {
    opacity: 1;
}
body.theme-amz .amz-hero-slider .carousel-control-prev-icon,
body.theme-amz .amz-hero-slider .carousel-control-next-icon {
    width: 48px;
    height: 48px;
    background-color: rgba(255,255,255,0.4);
    border-radius: 4px;
    border: 1px solid #131921;
    background-size: 50%;
    filter: invert(1);
}

/* ==================== TARJETAS SUPERPUESTAS (OVERLAPPING CARDS) ==================== */
body.theme-amz .amz-floating-cards {
    position: relative;
    z-index: 10;
    margin-top: -240px;
    margin-bottom: 24px;
}
body.theme-amz .amz-card-box {
    background: #ffffff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #D5D9D9;
    padding: 16px 16px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 420px;
    max-height: 420px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}
body.theme-amz .amz-card-box:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
body.theme-amz .amz-card-box .card-title-amz {
    font-size: 1.12rem;
    font-weight: 700;
    color: #0F1111;
    line-height: 1.25;
    margin-bottom: 8px;
    height: 40px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
body.theme-amz .amz-card-box .grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 130px);
    gap: 8px 10px;
    height: 270px;
    flex-shrink: 0;
    align-content: start;
}
body.theme-amz .amz-card-box .grid-item {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 130px;
    overflow: hidden;
}
body.theme-amz .amz-card-box .grid-img-wrap {
    width: 100%;
    height: 95px;
    max-height: 95px;
    background: #F8FAFC;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    border: 1px solid #EDEDED;
}
body.theme-amz .amz-card-box .grid-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
    transition: transform 0.2s ease;
}
body.theme-amz .amz-card-box .grid-item:hover .grid-img-wrap img {
    transform: scale(1.06);
}
body.theme-amz .amz-card-box .grid-img-wrap i {
    font-size: 2rem;
    color: var(--amz-accent, #0B6E4F);
}
body.theme-amz .amz-card-box .grid-label {
    font-size: 0.72rem;
    color: #0F1111;
    line-height: 1.2;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.theme-amz .amz-card-box .single-feature-wrap {
    height: 270px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
}
body.theme-amz .amz-card-box .single-feature-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #F8FAFC;
    border-radius: 4px;
    border: 1px solid #EDEDED;
    padding: 8px;
    margin-bottom: 8px;
}
body.theme-amz .amz-card-box .card-link-amz {
    color: var(--links, #007185);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    margin-top: auto;
    padding-top: 6px;
    display: inline-block;
    flex-shrink: 0;
}
body.theme-amz .amz-card-box .card-link-amz:hover {
    color: var(--primary, #C7511F);
    text-decoration: underline;
}

/* ==================== STRIPS DE PRODUCTOS DESTACADOS ==================== */
body.theme-amz .amz-products-strip {
    background: #ffffff;
    border: 1px solid #D5D9D9;
    padding: 20px 20px 24px;
    margin-bottom: 24px;
}
body.theme-amz .amz-products-strip .strip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E7E7E7;
}
body.theme-amz .amz-products-strip .strip-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0F1111;
    margin: 0;
}
body.theme-amz .amz-products-strip .strip-link {
    color: var(--links, #007185);
    font-size: 0.86rem;
    text-decoration: none;
    font-weight: 500;
}
body.theme-amz .amz-products-strip .strip-link:hover {
    color: var(--primary, #C7511F);
    text-decoration: underline;
}

/* Tarjetas de Producto estilo Marketplace AMZ */
body.theme-amz .product-card {
    background: #ffffff;
    border: 1px solid #E7E7E7;
    border-radius: 8px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
body.theme-amz .product-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    border-color: #D5D9D9;
}
body.theme-amz .product-card-img {
    background: #F7F8F8;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
}
body.theme-amz .product-card-img img {
    max-height: 100%;
    width: 100%;
    object-fit: contain;
}
body.theme-amz .product-card-body {
    padding: 12px 14px 6px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}
body.theme-amz .product-card-body .product-name {
    color: var(--links, #007185) !important;
    font-size: 0.88rem !important;
    line-height: 1.35;
    font-weight: 500;
    margin: 2px 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
body.theme-amz .product-card-body .product-name:hover {
    color: var(--primary, #C7511F) !important;
    text-decoration: underline;
}

/* Precios AMZ */
body.theme-amz .product-price {
    color: var(--primary, #0F1111) !important;
    font-size: 1.15rem;
    font-weight: 700 !important;
}

/* Acciones y Botones de Tarjetas AMZ */
body.theme-amz .product-card-footer {
    padding: 8px 12px 12px;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

body.theme-amz .btn-card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 34px;
    line-height: 1;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 20px !important;
    padding: 0 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    min-width: 0;
    box-sizing: border-box;
}
body.theme-amz .btn-card-action i {
    font-size: 0.84rem;
    flex-shrink: 0;
}
body.theme-amz .btn-card-action .btn-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Botón Ver estilo AMZ Secundario */
body.theme-amz .btn-card-view {
    flex: 1 1 0;
    background: #ffffff !important;
    border: 1px solid #D5D9D9 !important;
    color: #0F1111 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body.theme-amz .btn-card-view:hover {
    background: #F7FAFA !important;
    border-color: #A6A9A9 !important;
    color: #0F1111 !important;
}

/* Botón Agregar estilo AMZ Primario */
body.theme-amz .btn-card-add {
    flex: 1.25 1 0;
    background: var(--amz-btn, #FFD814) !important;
    border: 1px solid #FCD200 !important;
    color: #0F1111 !important;
    box-shadow: 0 2px 5px rgba(213,217,217,.5);
}
body.theme-amz .btn-card-add:hover {
    background: var(--amz-btn-hover, #F7CA00) !important;
    border-color: #F2C200 !important;
    color: #0F1111 !important;
    transform: translateY(-1px);
}

/* Botón Agotado estilo AMZ */
body.theme-amz .btn-card-out {
    flex: 1 1 0;
    background: #F0F2F2 !important;
    border: 1px solid #D5D9D9 !important;
    color: #565959 !important;
    cursor: not-allowed;
    opacity: 0.85;
}

/* Botones generales fuera de tarjetas */
body.theme-amz .btn-primary-dlife,
body.theme-amz .btn-amz-yellow,
body.theme-amz .btn-primary:not(.btn-card-action) {
    background: var(--amz-btn, #FFD814) !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    border-radius: 20px !important;
    color: #0F1111 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    padding: 7px 18px !important;
    box-shadow: 0 2px 5px rgba(213,217,217,.5);
    transition: background 0.15s ease, opacity 0.15s ease;
}
body.theme-amz .btn-primary-dlife:hover,
body.theme-amz .btn-amz-yellow:hover,
body.theme-amz .btn-primary:not(.btn-card-action):hover {
    background: var(--amz-btn-hover, #F7CA00) !important;
    opacity: 0.92;
    color: #0F1111 !important;
}

/* Badges de Disponibilidad */
body.theme-amz .badge.bg-success,
body.theme-amz .badge-avail {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #059669 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 50px;
    padding: 3px 8px;
}

/* Barra de Beneficios */
body.theme-amz .benefit-item {
    border: 1px solid #D5D9D9;
    background: #ffffff;
    border-radius: 4px;
    padding: 14px;
}
body.theme-amz .benefit-icon { color: var(--amz-accent); font-size: 1.5rem; }
body.theme-amz .benefit-title { color: #0F1111; font-weight: 700; font-size: 0.9rem; }
body.theme-amz .benefit-desc { color: #565959; font-size: 0.78rem; }

/* ==================== FOOTER AMZ ==================== */
body.theme-amz .site-footer {
    background: var(--footer-bg, var(--amz-subnav)) !important;
    color: var(--footer-text, rgba(255,255,255,0.85));
    padding-top: 0;
}
body.theme-amz .amz-back-to-top {
    background: var(--secondary-dark, #37475A);
    color: #ffffff;
    text-align: center;
    padding: 14px 0;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: opacity 0.15s;
}
body.theme-amz .amz-back-to-top:hover {
    opacity: 0.85;
    color: #ffffff;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
    body.theme-amz .amz-floating-cards {
        margin-top: -120px;
    }
    body.theme-amz .amz-hero-slider .carousel-item {
        height: 380px;
    }
    body.theme-amz .amz-hero-slider .carousel-item img {
        height: 380px;
    }
}
@media (max-width: 575px) {
    body.theme-amz .amz-floating-cards {
        margin-top: -40px;
    }
    body.theme-amz .amz-hero-slider .carousel-item {
        height: 240px;
    }
    body.theme-amz .amz-hero-slider .carousel-item img {
        height: 240px;
    }
    body.theme-amz .product-card {
        border-radius: 6px;
    }
    body.theme-amz .product-card-img {
        padding: 8px;
    }
    body.theme-amz .product-card-body {
        padding: 8px 8px 4px;
    }
    body.theme-amz .product-card-footer {
        padding: 4px 6px 8px;
        gap: 4px;
    }
    body.theme-amz .btn-card-action {
        height: 30px;
        font-size: 0.72rem;
        padding: 0 4px;
        gap: 3px;
    }
    body.theme-amz .btn-card-action i {
        font-size: 0.76rem;
    }
    body.theme-amz .btn-card-action .btn-text {
        font-size: 0.70rem;
    }
}

@media (max-width: 370px) {
    body.theme-amz .product-card-footer {
        padding: 3px 4px 6px;
        gap: 3px;
    }
    body.theme-amz .btn-card-action {
        height: 28px;
        padding: 0 2px;
        font-size: 0.68rem;
    }
    body.theme-amz .btn-card-action .btn-text {
        font-size: 0.66rem;
    }
}

/* Universal Availability Badges across all themes */
.badge-avail,
body.theme-amz .badge-avail,
body.theme-minimal .badge-avail {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px;
    background: rgba(16, 185, 129, 0.12) !important;
    color: #059669 !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    padding: 2px 7px !important;
    border-radius: 50px !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.badge-out,
body.theme-amz .badge-out,
body.theme-minimal .badge-out {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px;
    background: rgba(239, 68, 68, 0.12) !important;
    color: #dc2626 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    padding: 2px 7px !important;
    border-radius: 50px !important;
    font-size: 0.68rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* ==================== PAGINACIÓN ESTILO AMZ ==================== */
body.theme-amz .pagination {
    gap: 5px;
}
body.theme-amz .pagination .page-item .page-link {
    color: #0F1111;
    background-color: #ffffff;
    border: 1px solid #D5D9D9;
    border-radius: 4px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 600;
}
body.theme-amz .pagination .page-item .page-link:hover {
    color: #C45500;
    background-color: #F7FAFA;
    border-color: #D5D9D9;
    transform: translateY(-1px);
}
body.theme-amz .pagination .page-item.active .page-link {
    color: #0F1111 !important;
    background: var(--amz-btn, #FFD814) !important;
    border-color: #FCD200 !important;
    box-shadow: 0 2px 5px rgba(213,217,217,.5);
    font-weight: 700;
}
body.theme-amz .pagination .page-item.disabled .page-link {
    color: #565959;
    background-color: #F0F2F2;
    border-color: #D5D9D9;
}