/* ========================================
   SmartCatálogo - Catalog CSS
   Premium design with CSS variables
   ======================================== */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #e63946;
    --secondary: #1d1d1d;
    --primary-light: #e6394622;
    --primary-hover: #e63946dd;
    --bg: #f8f9fa;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-light: #6c757d;
    --text-muted: #adb5bd;
    --border: #e9ecef;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --whatsapp: #25D366;
    --whatsapp-hover: #1da851;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ========== HEADER ========== */
.catalog-header {
    background: var(--secondary);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
}

.store-logo img {
    height: 45px;
    width: auto;
    border-radius: 8px;
}

.store-logo-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.store-logo-text .logo-icon { font-size: 1.5rem; }
.store-logo-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
}

.search-form {
    flex: 1;
    display: flex;
    max-width: 400px;
    position: relative;
}

.search-form input {
    width: 100%;
    padding: 10px 45px 10px 16px;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    background: rgba(255,255,255,0.1);
    color: white;
    font-family: var(--font);
    transition: var(--transition);
}

.search-form input::placeholder { color: rgba(255,255,255,0.5); }
.search-form input:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 0 2px var(--primary);
}

.search-form button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.search-form button:hover { background: var(--primary-hover); transform: translateY(-50%) scale(1.05); }

.header-whatsapp {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--whatsapp);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    white-space: nowrap;
}

.header-whatsapp:hover {
    background: var(--whatsapp-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}

/* ========== CATEGORIES NAV ========== */
.categories-nav {
    background: white;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 69px;
    z-index: 90;
}

.categories-scroll {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    background: var(--bg);
    color: var(--text);
    transition: var(--transition);
    border: 1px solid var(--border);
}

.cat-pill:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.cat-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========== MAIN CONTENT ========== */
.catalog-main {
    min-height: 60vh;
    padding: 30px 0;
}

.section { margin-bottom: 40px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.section-description {
    color: var(--text-light);
    margin-top: -12px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.see-all {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.see-all:hover { opacity: 0.8; }

.results-count {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== PRODUCT GRID ========== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ========== PRODUCT CARD ========== */
.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.discount-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(255,65,108,0.3);
}

.discount-badge.large {
    padding: 6px 16px;
    font-size: 0.9rem;
}

.product-image {
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 3rem;
    background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
}

.product-placeholder.large { font-size: 5rem; }

.product-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.product-category {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-pricing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.price-old {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-current {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary);
}

.btn-whatsapp {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--whatsapp);
    color: white;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    margin-top: auto;
}

.btn-whatsapp:hover {
    background: var(--whatsapp-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}

/* ========== PRODUCT DETAIL ========== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.breadcrumb a:hover { color: var(--primary); }

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.main-image {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow);
}

.main-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.thumbnail-list {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.thumbnail {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    background: none;
    padding: 0;
}

.thumbnail.active, .thumbnail:hover { border-color: var(--primary); }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.product-info-detail { display: flex; flex-direction: column; gap: 16px; }

.product-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    width: fit-content;
}

.product-info-detail h1 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.product-pricing-detail { display: flex; flex-direction: column; gap: 4px; }

.price-old-detail {
    font-size: 1rem;
    color: var(--text-muted);
    text-decoration: line-through;
}

.price-current-detail {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--primary);
}

.savings {
    font-size: 0.9rem;
    color: var(--whatsapp);
    font-weight: 600;
    background: rgba(37,211,102,0.1);
    padding: 4px 12px;
    border-radius: 50px;
    width: fit-content;
}

.product-description h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}

.product-description p {
    color: var(--text-light);
    line-height: 1.7;
}

.btn-whatsapp-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--whatsapp);
    color: white;
    padding: 18px 32px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.1rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}

.btn-whatsapp-large:hover {
    background: var(--whatsapp-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37,211,102,0.4);
}

.share-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.share-section span { color: var(--text-light); font-size: 0.9rem; }

.share-btn {
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
}

.share-btn:hover { background: var(--bg); border-color: var(--primary); }

/* ========== WHATSAPP FLOAT ========== */
.whatsapp-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: var(--whatsapp);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37,211,102,0.4);
    z-index: 1000;
    transition: var(--transition);
    animation: pulse-float 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37,211,102,0.5);
}

@keyframes pulse-float {
    0%, 100% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
    50% { box-shadow: 0 4px 30px rgba(37,211,102,0.6); }
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .empty-icon { font-size: 4rem; display: block; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.empty-state p { color: var(--text-light); margin-bottom: 20px; }

/* ========== FOOTER ========== */
.catalog-footer {
    background: var(--secondary);
    color: rgba(255,255,255,0.8);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
}

.footer-info p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 6px;
}

.footer-social { display: flex; flex-direction: column; gap: 10px; }

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    background: rgba(255,255,255,0.1);
}

.social-link:hover { background: rgba(255,255,255,0.2); }
.social-link.whatsapp { color: var(--whatsapp); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

.powered-by a { color: var(--primary); font-weight: 600; }
.powered-by a:hover { text-decoration: underline; }

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: var(--font);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(230,57,70,0.3);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header-content { flex-wrap: wrap; }
    .search-form { order: 3; max-width: 100%; flex: 1 1 100%; }
    .header-whatsapp span { display: none; }
    .header-whatsapp { padding: 10px; border-radius: 50%; }
    .store-logo-text h1 { font-size: 1rem; }

    .categories-nav { top: auto; position: relative; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-detail { grid-template-columns: 1fr; gap: 24px; }
    .product-info-detail h1 { font-size: 1.4rem; }
    .price-current-detail { font-size: 1.8rem; }
    .footer-content { grid-template-columns: 1fr; gap: 20px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-info { padding: 10px; }
    .product-name { font-size: 0.85rem; }
    .price-current { font-size: 1rem; }
    .btn-whatsapp { padding: 10px; font-size: 0.8rem; }
}
