/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* -------------- FORZAR HEADER 2 FILAS -------------- */
header.store-header{
  padding:0;
}
header.store-header,
.store-header{
  display:block !important;
  width:100% !important;
  position:sticky !important;
  top:0 !important;
  z-index:1000 !important;
}

.header-top{
  display:block !important;
  width:100% !important;
  background:#81160E !important;
  padding:10px 0 !important;
}

.header-bottom{
  display:block !important;
  width:100% !important;
  background:#4F0E09 !important;
  padding:0 !important;
}

.header-content-wrapper{
  max-width:1300px !important;
  margin:0 auto !important;
  padding-left:0 !important;
  padding-right:0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
}
.header-bottom .header-content-wrapper{
  max-width:1350px !important;
}
/* -------------- /FORZAR HEADER 2 FILAS -------------- */

/* Logo */
.header-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.store-logo {
    max-height: 50px;
    width: auto;
}

/* Search */
.search-wrapper {
    flex: 1;
    max-width: 800px;
    margin: 0 20px;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 10px 15px;
    border: none;
    font-size: 14px;
    background-color: rgba(255,255,255,0.9);
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

/* Header Icons */
.header-icons {
    display: flex;
    gap: 20px;
}

.header-icons a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.header-icons a:hover {
    background-color: rgba(255,255,255,0.2);
}

.header-icons svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* --- Estilos para el Dropdown de Resultados de Búsqueda --- */
#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white-bg, white);
    border: 1px solid var(--border-color, #ddd);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1001;
    display: none; /* Oculto por defecto */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #eee);
    text-decoration: none;
    color: var(--text-dark, #333);
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background-color: var(--light-bg, #f8f9fa);
}
.search-result-item img {
    width: 40px;
    height: 40px;
    margin-right: 1rem;
    object-fit: cover;
    border-radius: 4px;
}
.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-light, #666);
}

/* Category Carousel */
.category-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.store-nav {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding: 0;
    flex: 1;
}

.store-nav::-webkit-scrollbar {
    display: none;
}

.store-nav a {
    color: white;
    text-decoration: none;
    white-space: nowrap;
    padding: 8px 16px;
    transition: background-color 0.3s;
    font-size: 13px;
    text-transform:uppercase;
}

.store-nav a:hover,
.store-nav a.active {
    background-color: rgba(255,255,255,0.2);
    color:#fff;
}

/* Carousel Arrows */
.carousel-arrow {
    color: white;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background-color 0.3s;
    position: absolute;
}
.carousel-arrow {
    /* fondo sólido para tapar lo de detrás */
    background: #4F0E09 !important;
    width: 40px !important;
    height: 100% !important;
    border-radius: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    z-index: 15 !important;   /* por encima de las categorías */
    display: flex !important; /* en móvil siempre visibles */
}

.carousel-arrow:hover {
    background-color: rgba(255,255,255,0.3);
}

.carousel-arrow.prev {
    left: 0 !important;
    background: linear-gradient(90deg, #4F0E09 70%, transparent 100%) !important;
}

.carousel-arrow.next {
    right: 0 !important;
    background: linear-gradient(-90deg, #4F0E09 70%, transparent 100%) !important;
}

/* Mostrar flechas solo cuando es necesario */
@media (min-width: 769px) {
    .carousel-arrow {
        display: none !important;
    }
    .category-carousel-wrapper.overflowing .carousel-arrow {
        display: flex !important;
    }
}

/* Main Content */
.store-container {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
}

.store-container h1 {
    margin-bottom: 30px;
    color: #333;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #ccc;
}

.product-info {
    padding: 15px;
}

.product-category {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: block;
}

.product-title {
    font-size: 16px;
    margin-bottom: 10px;
    color: #333;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #81160E;
}

/* Footer */
.store-footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 60px;
}

/* Responsive */
@media (max-width: 800px) {
    .search-wrapper {
        max-width: 300px;
    }
    .header-content-wrapper{
      padding-left:20px !important;
      padding-right:20px !important;
    }
    .header-bottom .header-content-wrapper{
      padding-left:0 !important;
      padding-right:0 !important;
    }
}

@media (max-width: 768px) {
    .header-content-wrapper {
        flex-wrap: wrap;
        gap: 0 15px;
        padding-left:10px !important;
        padding-right:10px !important;
    }
    
    .search-wrapper {
        order: 3;
        flex-basis: 100%;
        margin: 10px 0 0 0;
        max-width: none;
    }
    
    .store-nav {
        gap: 15px;
        padding: 10px 40px; /* Espacio para las flechas */
        -webkit-overflow-scrolling: touch; /* Scroll táctil suave en iOS */
    }
    
    /* Mostrar flechas siempre en móvil */
    .carousel-arrow {
        display: flex !important;
    }
    
    .carousel-arrow {
    background-color: transparent;
}

    .carousel-arrow:hover {
        background-color: rgba(255,255,255,0.3);
    }
    
    .carousel-arrow.prev {
        left: 10px;
    }
    
    .carousel-arrow.next {
        right: 10px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .header-content-wrapper {
        padding: 0 15px;
    }
    
    .store-logo {
        max-height: 40px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.cart-icon-wrapper {
    position: relative;
}
.cart-item-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #FFC000;
    color: #000;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}