/*
 * ESTAFETA Marketplace - Estilos Personalizados
 * Version: 1.0.0
 */

/* =============================================
   Variables CSS
============================================= */
:root {
    --primary:     #ff6b35;
    --primary-dark:#e55a25;
    --secondary:   #2c3e50;
    --accent:      #f39c12;
    --success:     #27ae60;
    --danger:      #e74c3c;
    --warning:     #f1c40f;
    --light-bg:    #f8f9fa;
    --border:      #e9ecef;
    --text-dark:   #2c3e50;
    --text-muted:  #6c757d;
    --shadow-sm:   0 2px 10px rgba(0,0,0,.06);
    --shadow-md:   0 5px 25px rgba(0,0,0,.10);
    --shadow-lg:   0 10px 40px rgba(0,0,0,.15);
    --radius:      12px;
    --transition:  all 0.25s ease;
}

/* =============================================
   Reset y Base
============================================= */
*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; color: var(--text-dark); background: #fff; }
a { text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }
.section-title { font-weight: 800; font-size: 1.8rem; color: var(--secondary); margin-bottom: 0.5rem; }
.section-title span { color: var(--primary); }
.section-subtitle { color: var(--text-muted); margin-bottom: 2.5rem; }

/* =============================================
   Topbar
============================================= */
.topbar {
    background: var(--secondary);
    color: rgba(255,255,255,.85);
    font-size: .82rem;
    padding: 6px 0;
}
.topbar a { color: rgba(255,255,255,.7); transition: var(--transition); }
.topbar a:hover { color: #fff; }
.topbar .social-links a { margin-left: 12px; font-size: .9rem; }

/* =============================================
   Navbar Principal
============================================= */
.navbar-estafeta {
    background: #fff;
    box-shadow: var(--shadow-sm);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1040;
    transition: var(--transition);
}
.navbar-estafeta.scrolled { box-shadow: var(--shadow-md); }
.navbar-brand { display: flex; align-items: center; gap: 10px; }
.navbar-brand .brand-logo { height: 44px; }
.navbar-brand .brand-name {
    font-size: 1.6rem; font-weight: 900; letter-spacing: 2px;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* Search Bar */
.search-form { position: relative; flex: 1; max-width: 500px; }
.search-form input {
    border-radius: 50px 0 0 50px; border: 2px solid var(--border); padding: 10px 20px;
    font-size: .95rem; transition: var(--transition); width: 100%;
}
.search-form input:focus { border-color: var(--primary); box-shadow: none; outline: none; }
.search-form .btn-search {
    border-radius: 0 50px 50px 0; background: var(--primary); color: #fff;
    padding: 10px 20px; border: 2px solid var(--primary); cursor: pointer;
    transition: var(--transition);
}
.search-form .btn-search:hover { background: var(--primary-dark); }

/* Autocomplete dropdown */
.search-dropdown {
    position: absolute; top: 110%; left: 0; right: 0; z-index: 9999;
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
    border: 1px solid var(--border); overflow: hidden; display: none;
}
.search-dropdown .search-item {
    display: flex; align-items: center; padding: 10px 15px; transition: var(--transition);
    cursor: pointer; gap: 12px;
}
.search-dropdown .search-item:hover { background: var(--light-bg); }
.search-dropdown .search-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.search-dropdown .search-item-info .name { font-weight: 600; font-size: .9rem; color: var(--text-dark); }
.search-dropdown .search-item-info .price { color: var(--primary); font-size: .85rem; }

/* Cart Icon */
.cart-icon { position: relative; display: inline-flex; align-items: center; }
.cart-icon .badge {
    position: absolute; top: -8px; right: -8px; background: var(--primary);
    color: #fff; font-size: .7rem; width: 18px; height: 18px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}

/* =============================================
   Hero / Slider
============================================= */
.hero-section { background: var(--secondary); }

/* Imagen del slide */
.hero-img {
    height: 480px;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Caption del carousel */
.hero-section .carousel-caption {
    background: linear-gradient(transparent, rgba(44,62,80,.85));
    bottom: 0; left: 0; right: 0;
    padding: 80px 40px 40px;
    text-align: left;
    border-radius: 0;
}
.hero-section .carousel-caption h1 {
    font-size: 2.5rem;
    font-weight: 800;
    text-shadow: 0 2px 8px rgba(0,0,0,.4);
    line-height: 1.2;
}
.carousel-indicators [data-bs-target] {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255,255,255,.6); border: none;
    transition: all .3s;
}
.carousel-indicators .active { background: var(--primary); width: 26px; border-radius: 5px; }

/* Fallback por si no hay banners cargados */
.hero-section .carousel-item { min-height: 300px; }

/* Legacy support para .hero-slider */
.hero-slider .carousel-item { height: 480px; overflow: hidden; }
.hero-slider .carousel-item img { width: 100%; height: 100%; object-fit: cover; }
.hero-slider .carousel-caption {
    background: linear-gradient(transparent, rgba(44,62,80,.8));
    bottom: 0; left: 0; right: 0; padding: 50px 40px 40px;
    text-align: left;
}

/* =============================================
   Sección de Categorías
============================================= */
.categories-section { padding: 60px 0; background: var(--light-bg); }
.category-card {
    background: #fff; border-radius: 16px; padding: 25px 20px;
    text-align: center; transition: var(--transition);
    box-shadow: var(--shadow-sm); cursor: pointer; display: block; color: var(--text-dark);
}
.category-card:hover {
    transform: translateY(-8px); box-shadow: var(--shadow-md);
    color: var(--primary);
}
.category-card .cat-icon {
    width: 65px; height: 65px; border-radius: 50%; margin: 0 auto 15px;
    display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; transition: var(--transition);
}
.category-card:hover .cat-icon { transform: rotate(10deg) scale(1.1); }
.category-card .cat-name { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.category-card .cat-count { color: var(--text-muted); font-size: .8rem; }

/* =============================================
   Cards de Producto
============================================= */
.product-card {
    background: #fff; border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); box-shadow: var(--shadow-sm);
    height: 100%; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.product-card-img {
    position: relative; overflow: hidden;
    padding-top: 75%; /* 4:3 ratio */
}
.product-card-img img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; transition: transform 0.4s ease;
}
.product-card:hover .product-card-img img { transform: scale(1.05); }

.product-card-overlay {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(44,62,80,.15); opacity: 0; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.product-card:hover .product-card-overlay { opacity: 1; }
.product-card-overlay .btn-action {
    width: 40px; height: 40px; border-radius: 50%; background: #fff;
    color: var(--secondary); border: none; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center; font-size: .9rem;
    transform: translateY(15px);
}
.product-card:hover .product-card-overlay .btn-action { transform: translateY(0); }
.product-card-overlay .btn-action:hover { background: var(--primary); color: #fff; }

.badge-discount {
    position: absolute; top: 12px; left: 12px;
    background: var(--danger); color: #fff; padding: 4px 10px;
    border-radius: 50px; font-size: .75rem; font-weight: 700;
}
.badge-new {
    position: absolute; top: 12px; right: 12px;
    background: var(--success); color: #fff; padding: 4px 10px;
    border-radius: 50px; font-size: .75rem; font-weight: 700;
}

.product-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-card-store { font-size: .75rem; color: var(--text-muted); margin-bottom: 4px; }
.product-card-title { font-weight: 600; font-size: .95rem; color: var(--text-dark); margin-bottom: 8px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-rating { display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }
.product-card-rating .stars { color: var(--accent); font-size: .8rem; }
.product-card-rating .count { font-size: .78rem; color: var(--text-muted); }
.product-card-price { margin-top: auto; }
.product-card-price .price-current { font-weight: 800; font-size: 1.15rem; color: var(--primary); }
.product-card-price .price-original { font-size: .85rem; color: var(--text-muted); text-decoration: line-through; margin-left: 6px; }
.btn-add-cart {
    background: var(--primary); color: #fff; border: none; border-radius: 8px;
    padding: 8px 16px; font-size: .85rem; font-weight: 600; width: 100%;
    margin-top: 12px; cursor: pointer; transition: var(--transition);
}
.btn-add-cart:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* =============================================
   Cards de Tienda
============================================= */
.tienda-card {
    background: #fff; border-radius: var(--radius); overflow: hidden;
    transition: var(--transition); box-shadow: var(--shadow-sm);
}
.tienda-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.tienda-card-banner { height: 120px; background: linear-gradient(135deg, var(--secondary), var(--primary)); overflow: hidden; }
.tienda-card-banner img { width: 100%; height: 100%; object-fit: cover; }
.tienda-card-body { padding: 16px; text-align: center; margin-top: -30px; }
.tienda-card-logo { width: 60px; height: 60px; border-radius: 50%; border: 3px solid #fff; object-fit: cover; background: #fff; }
.tienda-card-name { font-weight: 700; margin: 10px 0 4px; font-size: 1rem; }
.tienda-card-badge { font-size: .75rem; }
.tienda-card-stats { display: flex; justify-content: center; gap: 20px; margin: 10px 0; font-size: .8rem; color: var(--text-muted); }
.btn-ver-tienda { background: linear-gradient(90deg, var(--primary), var(--primary-dark)); color: #fff; border: none; border-radius: 8px; padding: 8px 20px; font-weight: 600; font-size: .85rem; cursor: pointer; transition: var(--transition); }
.btn-ver-tienda:hover { transform: translateY(-1px); box-shadow: 0 4px 15px rgba(255,107,53,.4); }

/* =============================================
   Secciones de Productos
============================================= */
.products-section { padding: 60px 0; }
.products-section:nth-child(even) { background: var(--light-bg); }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; flex-wrap: wrap; gap: 15px; }
.ver-mas-link { color: var(--primary); font-weight: 600; font-size: .9rem; display: flex; align-items: center; gap: 5px; }
.ver-mas-link:hover { color: var(--primary-dark); }

/* =============================================
   Carrito
============================================= */
.cart-item {
    background: #fff; border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-sm); margin-bottom: 15px;
    display: grid; grid-template-columns: 90px 1fr auto; gap: 15px; align-items: center;
}
.cart-item-img { width: 90px; height: 90px; border-radius: 10px; object-fit: cover; }
.cart-item-info .product-name { font-weight: 600; margin-bottom: 5px; }
.cart-item-info .product-store { font-size: .8rem; color: var(--text-muted); }
.cart-item-info .product-attrs { font-size: .8rem; color: var(--text-muted); }
.quantity-control { display: flex; align-items: center; gap: 8px; }
.quantity-control button { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border); background: #fff; cursor: pointer; font-weight: 700; transition: var(--transition); }
.quantity-control button:hover { border-color: var(--primary); color: var(--primary); }
.quantity-control input { width: 50px; text-align: center; border: 1.5px solid var(--border); border-radius: 8px; padding: 5px; }
.cart-item-price { font-weight: 800; color: var(--primary); font-size: 1.1rem; white-space: nowrap; }

/* Order Summary */
.order-summary {
    background: #fff; border-radius: var(--radius); padding: 25px;
    box-shadow: var(--shadow-sm); position: sticky; top: 80px;
}
.order-summary .summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: .95rem; }
.order-summary .summary-row.total { font-weight: 800; font-size: 1.2rem; border-top: 2px solid var(--border); padding-top: 15px; margin-top: 5px; }
.order-summary .total-price { color: var(--primary); font-size: 1.4rem; }
.btn-checkout { background: linear-gradient(90deg, var(--primary), var(--primary-dark)); color: #fff; border: none; width: 100%; padding: 14px; border-radius: 10px; font-size: 1.05rem; font-weight: 700; cursor: pointer; transition: var(--transition); margin-top: 15px; }
.btn-checkout:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,107,53,.4); }

/* Cupón */
.cupon-form { display: flex; gap: 8px; margin: 15px 0; }
.cupon-form input { flex: 1; border-radius: 8px; border: 1.5px solid var(--border); padding: 10px; font-size: .9rem; }
.cupon-form .btn-cupon { background: var(--secondary); color: #fff; border: none; border-radius: 8px; padding: 10px 15px; cursor: pointer; font-weight: 600; transition: var(--transition); }

/* =============================================
   Checkout
============================================= */
.checkout-steps { display: flex; justify-content: center; gap: 0; margin-bottom: 40px; }
.checkout-step { display: flex; align-items: center; }
.checkout-step .step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--border); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-weight: 700; transition: var(--transition); }
.checkout-step.active .step-num { background: var(--primary); color: #fff; }
.checkout-step.done .step-num { background: var(--success); color: #fff; }
.checkout-step .step-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); margin: 0 15px; }
.checkout-step.active .step-label { color: var(--primary); }
.checkout-step-line { width: 60px; height: 2px; background: var(--border); }

/* =============================================
   Página de Producto
============================================= */
.product-gallery { position: sticky; top: 80px; }
.product-main-img { border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.product-main-img img { width: 100%; border-radius: var(--radius); }
.product-thumbnails { display: flex; gap: 8px; flex-wrap: wrap; }
.product-thumbnails img { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); cursor: pointer; transition: var(--transition); }
.product-thumbnails img.active, .product-thumbnails img:hover { border-color: var(--primary); }

.product-detail-title { font-size: 1.6rem; font-weight: 800; color: var(--text-dark); margin-bottom: 10px; }
.product-detail-price .price-main { font-size: 2rem; font-weight: 900; color: var(--primary); }
.product-detail-price .price-old { font-size: 1.1rem; color: var(--text-muted); text-decoration: line-through; margin-left: 10px; }
.product-detail-price .badge-off { background: var(--danger); color: #fff; padding: 4px 10px; border-radius: 50px; font-weight: 700; font-size: .85rem; vertical-align: middle; }

.attr-group { margin-bottom: 18px; }
.attr-group label { font-weight: 700; margin-bottom: 8px; display: block; }
.attr-options { display: flex; flex-wrap: wrap; gap: 8px; }
.attr-btn { padding: 6px 16px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; font-weight: 600; font-size: .85rem; transition: var(--transition); background: #fff; }
.attr-btn:hover, .attr-btn.active { border-color: var(--primary); background: rgba(255,107,53,.08); color: var(--primary); }
.attr-color { width: 35px; height: 35px; border-radius: 50%; padding: 0; }
.attr-color.active { outline: 3px solid var(--primary); outline-offset: 3px; }

.stock-badge { display: inline-block; padding: 5px 14px; border-radius: 50px; font-weight: 600; font-size: .85rem; }
.stock-badge.en-stock { background: #d4edda; color: #155724; }
.stock-badge.agotado { background: #f8d7da; color: #721c24; }
.stock-badge.poco-stock { background: #fff3cd; color: #856404; }

/* =============================================
   Ratings / Reviews
============================================= */
.rating-summary { display: flex; align-items: center; gap: 30px; padding: 25px; background: var(--light-bg); border-radius: var(--radius); margin-bottom: 20px; }
.rating-big { font-size: 3.5rem; font-weight: 900; color: var(--text-dark); line-height: 1; }
.rating-stars-big { font-size: 1.3rem; color: var(--accent); }
.rating-bars .rating-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: .85rem; }
.rating-bars .bar-bg { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.rating-bars .bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }

.review-item { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 15px; }
.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.review-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.review-author { font-weight: 700; font-size: .95rem; }
.review-date { font-size: .8rem; color: var(--text-muted); }

/* =============================================
   Newsletter Section
============================================= */
.newsletter-section {
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    color: #fff; padding: 60px 0; text-align: center;
}
.newsletter-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.newsletter-section p { opacity: .85; margin-bottom: 30px; font-size: 1.05rem; }
.newsletter-form { display: flex; max-width: 500px; margin: 0 auto; gap: 0; }
.newsletter-form input { flex: 1; padding: 14px 20px; border: none; border-radius: 50px 0 0 50px; font-size: 1rem; outline: none; }
.newsletter-form button { background: var(--secondary); color: #fff; border: none; border-radius: 0 50px 50px 0; padding: 14px 28px; font-weight: 700; cursor: pointer; transition: var(--transition); }
.newsletter-form button:hover { background: #1a252f; }

/* =============================================
   Testimonios
============================================= */
.testimonios-section { padding: 60px 0; background: var(--light-bg); }
.testimonio-card { background: #fff; border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-sm); height: 100%; }
.testimonio-card .stars { color: var(--accent); font-size: 1.1rem; margin-bottom: 15px; }
.testimonio-card .text { font-size: .95rem; color: var(--text-muted); font-style: italic; line-height: 1.7; margin-bottom: 20px; }
.testimonio-card .author { display: flex; align-items: center; gap: 12px; }
.testimonio-card .author img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.testimonio-card .author-name { font-weight: 700; }
.testimonio-card .author-location { font-size: .8rem; color: var(--text-muted); }

/* =============================================
   Favoritos
============================================= */
.btn-favorito {
    background: none; border: none; cursor: pointer; font-size: 1.2rem;
    color: var(--text-muted); transition: var(--transition); padding: 0;
}
.btn-favorito.active { color: var(--danger); }
.btn-favorito:hover { color: var(--danger); transform: scale(1.2); }

/* =============================================
   Filtros del Catálogo
============================================= */
.filtros-sidebar {
    background: #fff; border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-sm); position: sticky; top: 80px;
}
.filtro-group { margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.filtro-group:last-child { border-bottom: none; }
.filtro-group h6 { font-weight: 700; margin-bottom: 12px; color: var(--text-dark); font-size: .95rem; }
.price-range-inputs { display: flex; gap: 8px; align-items: center; }
.price-range-inputs input { flex: 1; padding: 8px; border: 1.5px solid var(--border); border-radius: 8px; font-size: .85rem; }
.price-range-inputs span { color: var(--text-muted); }
.filtro-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filtro-chip { padding: 5px 12px; border-radius: 50px; border: 1.5px solid var(--border); font-size: .82rem; cursor: pointer; transition: var(--transition); background: #fff; }
.filtro-chip:hover, .filtro-chip.active { border-color: var(--primary); background: rgba(255,107,53,.08); color: var(--primary); }

/* Ordenar */
.sort-bar { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 10px; padding: 12px 18px; margin-bottom: 20px; box-shadow: var(--shadow-sm); flex-wrap: wrap; gap: 10px; }
.sort-bar .total-results { font-size: .9rem; color: var(--text-muted); font-weight: 600; }
.sort-select { border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: .9rem; cursor: pointer; }

/* =============================================
   Paginación
============================================= */
.pagination { justify-content: center; gap: 5px; }
.page-link { border-radius: 8px !important; border: 1.5px solid var(--border); color: var(--text-dark); padding: 8px 14px; transition: var(--transition); }
.page-link:hover, .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color: #fff; }

/* =============================================
   Mi Cuenta
============================================= */
.account-sidebar { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.account-user-header { background: linear-gradient(135deg, var(--secondary), var(--primary)); padding: 25px; text-align: center; color: #fff; }
.account-user-header .user-avatar { width: 80px; height: 80px; border-radius: 50%; border: 3px solid rgba(255,255,255,.5); object-fit: cover; margin-bottom: 12px; }
.account-user-header .user-name { font-weight: 700; font-size: 1.05rem; }
.account-user-header .user-role { font-size: .8rem; opacity: .8; }
.account-nav { padding: 10px 0; }
.account-nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--text-dark); font-weight: 500; transition: var(--transition); }
.account-nav-link:hover, .account-nav-link.active { background: rgba(255,107,53,.08); color: var(--primary); border-left: 3px solid var(--primary); }
.account-nav-link i { width: 20px; text-align: center; }

/* =============================================
   Footer
============================================= */
.footer-main { background: var(--secondary); color: rgba(255,255,255,.8); padding: 60px 0 30px; }
.footer-logo .brand-name { font-size: 1.8rem; font-weight: 900; color: #fff; letter-spacing: 2px; }
.footer-desc { font-size: .9rem; line-height: 1.7; margin: 15px 0; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); margin-right: 8px; transition: var(--transition); font-size: .9rem; }
.footer-social a:hover { background: var(--primary); color: #fff; transform: translateY(-3px); }
.footer-title { color: #fff; font-weight: 700; margin-bottom: 20px; font-size: 1rem; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: rgba(255,255,255,.65); font-size: .9rem; transition: var(--transition); }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }
.footer-contact-item { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-contact-item i { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.footer-contact-item span { color: rgba(255,255,255,.75); font-size: .9rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; margin-top: 40px; }
.footer-bottom p { margin: 0; font-size: .85rem; color: rgba(255,255,255,.5); }
.payment-methods img { height: 30px; margin-left: 8px; filter: grayscale(100%) brightness(2); opacity: .7; }

/* =============================================
   Animaciones
============================================= */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.animate-fade-up { animation: fadeInUp .5s ease both; }
.animate-delay-1 { animation-delay: .1s; }
.animate-delay-2 { animation-delay: .2s; }
.animate-delay-3 { animation-delay: .3s; }

/* Back to top */
.btn-back-top { position: fixed; bottom: 30px; right: 30px; width: 45px; height: 45px; background: var(--primary); color: #fff; border: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; visibility: hidden; transition: var(--transition); z-index: 9999; box-shadow: var(--shadow-md); }
.btn-back-top.visible { opacity: 1; visibility: visible; }
.btn-back-top:hover { background: var(--primary-dark); transform: translateY(-3px); }

/* =============================================
   Alertas y Badges
============================================= */
.badge-estafeta { background: var(--primary); color: #fff; }
.alert-estafeta { background: rgba(255,107,53,.1); border-left: 4px solid var(--primary); color: var(--primary-dark); border-radius: 8px; padding: 12px 18px; }

/* =============================================
   Página de Error / Empty State
============================================= */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state i { font-size: 4rem; color: var(--border); margin-bottom: 20px; }
.empty-state h4 { color: var(--text-dark); margin-bottom: 10px; }
.empty-state p { color: var(--text-muted); }

/* =============================================
   Responsive
============================================= */
@media (max-width: 992px) {
    .hero-slider .carousel-item { height: 350px; }
    .hero-slider .carousel-caption h2 { font-size: 1.8rem; }
    .category-card { padding: 15px; }
}

@media (max-width: 768px) {
    .hero-slider .carousel-item { height: 260px; }
    .hero-slider .carousel-caption { padding: 30px 20px 20px; }
    .hero-slider .carousel-caption h2 { font-size: 1.4rem; }
    .section-title { font-size: 1.4rem; }
    .newsletter-form { flex-direction: column; }
    .newsletter-form input, .newsletter-form button { border-radius: 50px; }
    .cart-item { grid-template-columns: 70px 1fr; }
    .filtros-sidebar { position: relative; top: 0; }
}

@media (max-width: 576px) {
    .topbar { display: none; }
    .navbar-brand .brand-name { font-size: 1.3rem; }
    .sort-bar { flex-direction: column; text-align: center; }
}

/* =======================================================
   TOPBAR ESTAFETA
======================================================= */
.topbar-estafeta {
    background: var(--secondary);
    color: rgba(255,255,255,.85);
    font-size: .8rem;
    padding: 5px 0;
    z-index: 1050;
}
.topbar-estafeta .text-white-75 { color: rgba(255,255,255,.75); }
.topbar-social {
    color: rgba(255,255,255,.7);
    font-size: .85rem;
    transition: color .2s;
    text-decoration: none;
}
.topbar-social:hover { color: var(--primary); }

/* =======================================================
   SITE HEADER — estructura de 2 filas independientes
======================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

/* ── Fila 1: logo + buscador + acciones ── */
.header-main { padding: 10px 0; }
.header-main-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
}
.logo-icon { font-size: 1.7rem; color: var(--primary); line-height: 1; }
.logo-text {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--secondary);
    text-transform: uppercase;
}
.logo-accent { color: var(--primary); }

/* ── Buscador ── */
.header-search {
    flex: 1;
    min-width: 0;
    max-width: 580px;
    position: relative;
}
.search-box {
    display: flex;
    align-items: stretch;
    border: 2px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
    background: #fff;
    transition: border-color .2s;
    height: 44px;
}
.search-box:focus-within { border-color: var(--primary); }
.search-cat-select {
    border: none;
    border-right: 1px solid var(--border);
    background: #f8f9fa;
    font-size: .8rem;
    width: 120px;
    min-width: 90px;
    flex-shrink: 0;
    padding: 0 8px 0 14px;
    cursor: pointer;
    outline: none;
    color: var(--text-dark);
    -webkit-appearance: auto;
    appearance: auto;
}
.search-text-input {
    flex: 1;
    border: none;
    padding: 0 14px;
    font-size: .92rem;
    outline: none;
    background: transparent;
    min-width: 0;
    color: var(--text-dark);
}
.search-text-input::placeholder { color: var(--text-muted); }
.search-submit-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    transition: background .2s;
    font-size: 1rem;
    flex-shrink: 0;
}
.search-submit-btn:hover { background: var(--primary-dark); }

/* Sugerencias autocomplete */
.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    display: none;
    max-height: 380px;
    overflow-y: auto;
}
.search-suggestions.show { display: block; }
.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background .15s;
    border-bottom: 1px solid #f5f5f5;
}
.suggestion-item:hover { background: var(--light-bg); }
.suggestion-item img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.suggestion-item .sug-name { font-size: .88rem; font-weight: 600; }
.suggestion-item .sug-price { font-size: .82rem; color: var(--primary); }

/* ── Acciones derechas ── */
.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Botón acción (carrito, favoritos, usuario) */
.hdr-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--secondary);
    cursor: pointer;
    transition: background .15s, color .15s;
    text-decoration: none;
    font-size: .75rem;
    line-height: 1;
    white-space: nowrap;
}
.hdr-btn:hover, .hdr-btn:focus { background: var(--light-bg); color: var(--primary); }
.hdr-btn-icon { position: relative; font-size: 1.2rem; line-height: 1; }
.hdr-badge {
    position: absolute;
    top: -7px; right: -8px;
    background: var(--primary);
    color: #fff;
    font-size: .6rem;
    font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 10px;
    padding: 0 3px;
    display: flex; align-items: center; justify-content: center;
}
.hdr-btn-label { font-size: .7rem; font-weight: 500; color: var(--text-muted); }

/* Dropdown usuario */
.user-dropdown {
    min-width: 240px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 4px 0;
}
.user-dropdown .dropdown-item { padding: 8px 16px; font-size: .9rem; transition: background .15s; }
.user-dropdown .dropdown-item:hover { background: var(--light-bg); color: var(--primary); }
.user-avatar-sm {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700;
    flex-shrink: 0;
}

/* Botón registro */
.btn-primary-est {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    border-radius: 8px;
    font-weight: 500;
    transition: background .2s;
    display: inline-flex;
    align-items: center;
}
.btn-primary-est:hover { background: var(--primary-dark); color: #fff; border-color: var(--primary-dark); }

/* Botón menú móvil */
.mobile-menu-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1.1rem;
    color: var(--secondary);
    padding: 6px 11px;
    cursor: pointer;
    line-height: 1;
    transition: background .15s;
}
.mobile-menu-btn:hover { background: var(--light-bg); }

/* ── Fila 2: barra de categorías (solo desktop) ── */
.header-cats {
    border-top: 1px solid var(--border);
    background: #fff;
}
.cats-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 3px 0;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.cats-nav::-webkit-scrollbar { display: none; }
.cats-item { position: relative; flex-shrink: 0; }
.cats-link {
    display: block;
    padding: 7px 14px;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.cats-link:hover { background: var(--light-bg); color: var(--primary); }
.cats-all-toggle { font-weight: 600; color: var(--secondary); }

/* Mega menu categorías */
.cats-mega-menu {
    position: absolute !important;
    left: 0;
    min-width: 540px;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg) !important;
    z-index: 1045;
    margin-top: 2px !important;
}
.cats-mega-item {
    padding: 6px 14px;
    font-size: .87rem;
    border-radius: 6px;
    color: var(--text-dark);
    transition: background .15s;
}
.cats-mega-item:hover { background: var(--light-bg); color: var(--primary); }

/* ── Menú móvil (collapse) ── */
.mobile-nav { background: #fff; border-top: 1px solid var(--border); }
.mobile-nav-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}
.mobile-nav-list li a {
    display: block;
    padding: 10px 16px;
    font-size: .92rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.mobile-nav-list li a:hover { background: var(--light-bg); color: var(--primary); }
.mobile-nav-list li a.text-danger:hover { background: #fff5f5; }
.mobile-nav-divider { height: 1px; background: var(--border); margin: 4px 0; }
.mobile-search .form-control { border-radius: 6px 0 0 6px !important; }

/* =======================================================
   FOOTER NEWSLETTER
======================================================= */
.footer-newsletter-section {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
}
.newsletter-input {
    border: none;
    border-radius: 50px 0 0 50px !important;
    padding-left: 20px;
}
.newsletter-input:focus { box-shadow: none; }
.btn-newsletter {
    background: #fff;
    color: var(--primary);
    border-radius: 0 50px 50px 0 !important;
    font-weight: 600;
    border: none;
    white-space: nowrap;
    transition: background .2s;
}
.btn-newsletter:hover { background: var(--light-bg); }

/* Footer brand */
.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.footer-logo-icon { font-size: 1.8rem; color: var(--primary); }
.footer-logo-text { font-size: 1.4rem; font-weight: 900; letter-spacing: 2px; color: #fff; }
.footer-logo-accent { color: var(--primary); }
.footer-description { color: rgba(255,255,255,.65); font-size: .9rem; line-height: 1.6; }
.footer-social { display: flex; gap: 8px; }
.footer-social-link {
    width: 36px; height: 36px;
    background: rgba(255,255,255,.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,.8);
    font-size: .85rem;
    transition: background .2s, color .2s;
    text-decoration: none;
}
.footer-social-link:hover { background: var(--primary); color: #fff; }

/* =======================================================
   BACK TO TOP
======================================================= */
.back-to-top {
    position: fixed;
    bottom: 28px; right: 28px;
    width: 44px; height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
    z-index: 9999;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* =======================================================
   RESPONSIVE - HEADER
======================================================= */
@media (max-width: 991.98px) {
    .header-main { padding: 8px 0; }
    .hdr-btn { padding: 5px 8px; }
    .hdr-btn-label { display: none !important; }
}
@media (max-width: 575.98px) {
    .topbar-estafeta { display: none !important; }
    .logo-text { font-size: 1.15rem; }
}
