/* ===================================================================
   STORE PEPE - ESTILOS GLOBALES
   Archivo centralizado de tema oscuro + componentes compartidos
   =================================================================== */

/* ===== VARIABLES DE TEMA ===== */
:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --text-primary: #f5f5f5;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --border-color: #2a2a2a;
    --shadow-color: rgba(0,0,0,0.3);
    --shadow-hover: rgba(0,0,0,0.5);
    --accent-color: #FB5533;
    --accent-text: #ffffff;
    --accent-secondary: #FF7A00;
    --price-color: #FF6B4A;
    --discount-bg: #FB5533;
    --skeleton-base: #1a1a1a;
    --skeleton-shine: #2a2a2a;
    --card-bg: #161616;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ===== RESET Y BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

/* ===== OVERRIDES TAILWIND → TEMA OSCURO ===== */
.bg-white { background-color: var(--card-bg) !important; }
.bg-gray-50 { background-color: var(--bg-secondary) !important; }
.bg-gray-100 { background-color: var(--bg-tertiary) !important; }
.bg-gray-200 { background-color: var(--bg-tertiary) !important; }

.text-gray-600,
.text-gray-500,
.text-gray-700 { color: var(--text-secondary) !important; }

.text-gray-400 { color: var(--text-muted) !important; }

.text-gray-900,
.text-gray-800,
.text-black { color: var(--text-primary) !important; }

.border-gray-200,
.border-gray-100,
.border-gray-300 { border-color: var(--border-color) !important; }

/* ===== ELEMENTOS INTERACTIVOS ===== */
select,
#countrySelector,
#countrySelectorMobile {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
select option {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

input,
textarea {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
input::placeholder,
textarea::placeholder {
    color: var(--text-muted) !important;
}

/* ===== HEADER / FOOTER / MENÚ MÓVIL ===== */
header {
    background-color: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}
footer {
    background-color: var(--bg-primary) !important;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px;
    z-index: 40;
    box-shadow: 0 4px 12px var(--shadow-color);
}
.mobile-menu.active { display: block; }
.mobile-menu a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-primary) !important;
}

/* ===== COMPONENTE: PRODUCT CARD ===== */
.product-card {
    transition: all 0.3s ease;
    cursor: pointer;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow-color);
    border: 1px solid var(--border-color);
    position: relative;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    border-color: rgba(251, 85, 51, 0.4);
}
.product-card img {
    transition: transform 0.3s;
}
.product-card:hover img {
    transform: scale(1.03);
}

/* ===== COMPONENTE: BOTÓN PRIMARIO ===== */
.btn-primary {
    background: linear-gradient(135deg, #FB5533, #FF7A00);
    color: #fff;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #e04a2c, #e06d00);
    transform: translateY(-2px);
}
.btn-primary:disabled {
    background: #555;
    cursor: not-allowed;
    transform: none;
}

/* ===== COMPONENTE: SKELETON LOADING ===== */
.skeleton {
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}
@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== COMPONENTE: BADGES MERCADOLIBRE-STYLE ===== */
.ml-oferta-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: linear-gradient(135deg, #FB5533, #FF7A00);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.ml-oferta-badge i { font-size: 8px; }

.ml-discount-pct {
    color: #FB5533;
    font-size: 12px;
    font-weight: 700;
}
.ml-original-price {
    color: #666;
    font-size: 0.75rem;
    text-decoration: line-through;
    font-weight: 400;
}
.ml-best-seller-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1a2520;
    border: 1px solid #166534;
    color: #4ade80;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}
.ml-ventas {
    font-size: 10px;
    color: #888;
}
.ml-disponible {
    font-size: 10px;
    color: #4ade80;
    display: flex;
    align-items: center;
    gap: 3px;
}
.ml-disponible i { font-size: 7px; }

.ml-stars { display: flex; align-items: center; gap: 1px; }
.ml-stars i { font-size: 10px; }
.ml-stars .filled { color: #FB5533; }
.ml-stars .empty { color: #333; }
.ml-review-count { font-size: 10px; color: #888; margin-left: 3px; }

.ml-price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

/* ===== COMPONENTE: QUICK CART BUTTON ===== */
.ml-quick-cart {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FB5533, #FF7A00);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(251,85,51,0.4);
    z-index: 10;
}
.product-card:hover .ml-quick-cart {
    opacity: 1;
    transform: scale(1);
}
.ml-quick-cart:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(251,85,51,0.6);
}

/* ===== COMPONENTE: TEMU-STYLE DISCOUNT RIBBON ===== */
.temu-discount {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #FB5533 0%, #FF7A00 100%);
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 12px 4px 8px;
    border-radius: 0 0 12px 0;
    z-index: 5;
    letter-spacing: 0.5px;
}
.temu-price {
    color: var(--price-color) !important;
    font-weight: 800 !important;
}

/* ===== COMPONENTE: CATEGORY BUTTONS ===== */
.category-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1.5px solid var(--border-color);
    transition: all 0.25s;
    cursor: pointer;
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.category-btn:hover {
    border-color: #FB5533;
    color: #FB5533;
    background: #2a1a15;
}
.category-btn.active {
    background: linear-gradient(135deg, #FB5533 0%, #FF7A00 100%);
    color: #ffffff;
    border-color: #FB5533;
    box-shadow: 0 2px 8px rgba(251, 85, 51, 0.3);
}

/* ===== COMPONENTE: SEARCH BOX ===== */
.search-box {
    position: relative;
}
.search-box input {
    padding-left: 44px;
    padding-right: 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}
.search-box input:focus {
    border-color: #FB5533;
    box-shadow: 0 0 0 2px rgba(251, 85, 51, 0.1);
}
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #FB5533;
    font-size: 1rem;
}

/* ===== RESPONSIVE GLOBAL ===== */
@media (max-width: 768px) {
    .desktop-nav { display: none !important; }
    footer .grid { grid-template-columns: 1fr 1fr !important; }
    
    /* Quick cart siempre visible en touch */
    .ml-quick-cart {
        opacity: 1 !important;
        transform: scale(1) !important;
    }

    /* Evitar hover lift en touch */
    .product-card:hover {
        transform: none;
    }

    /* Input zoom fix iOS */
    .search-box input {
        font-size: 16px !important;
    }
}
@media (max-width: 480px) {
    footer .grid { grid-template-columns: 1fr !important; }
}
