/* =============================================
   Proyecto Megu - Frontend CSS
   Diseño limpio, moderno, mobile-first
   ============================================= */

:root {
    --primary: #1a1a2e;
    --secondary: #e94560;
    --accent: #0f3460;
    --bg: #f8f9fa;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --success: #2ecc71;
    --whatsapp: #25d366;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --radius: 10px;
    --transition: all 0.3s ease;
    --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--gray-800);
    line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--secondary); }

img { max-width: 100%; height: auto; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* HEADER */
.site-header {
    background: var(--primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 65px;
}

.site-logo {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.site-logo span { color: var(--secondary); }

.site-nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.site-nav a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 500;
}

.site-nav a:hover, .site-nav a.active { color: #fff; }

.nav-whatsapp {
    background: var(--whatsapp);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85rem;
}

.nav-whatsapp:hover { background: #1da851; color: #fff !important; }

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

/* HERO SECTION */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 25px;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.hero-search input {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
}

.hero-search button {
    padding: 14px 28px;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.hero-search button:hover { background: #d63050; }

/* CATEGORIES BAR */
.categories-bar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 0;
    overflow-x: auto;
}

.categories-bar .container {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.cat-pill {
    padding: 8px 18px;
    background: var(--gray-100);
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
    transition: var(--transition);
}

.cat-pill:hover, .cat-pill.active {
    background: var(--accent);
    color: #fff;
}

/* PRODUCTS GRID */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 5px;
}

.section-subtitle {
    color: var(--gray-500);
    margin-bottom: 25px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

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

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.product-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--gray-200);
}

.product-card-img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    font-size: 0.85rem;
}

.product-card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-card-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.product-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-card-title a { color: inherit; }
.product-card-title a:hover { color: var(--secondary); }

.product-card-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 12px;
    flex: 1;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--secondary);
}

.product-price-old {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-decoration: line-through;
    margin-right: 6px;
}

.product-stock {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
}

.stock-in { background: #d4edda; color: #155724; }
.stock-out { background: #f8d7da; color: #721c24; }
.stock-low { background: #fff3cd; color: #856404; }

/* PRODUCT SINGLE PAGE */
.product-single {
    padding: 40px 0;
}

.product-single-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.product-gallery {
    position: sticky;
    top: 85px;
}

.product-main-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    background: var(--gray-200);
    margin-bottom: 10px;
}

.product-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.product-thumbs img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.product-thumbs img:hover,
.product-thumbs img.active { border-color: var(--secondary); }

.product-info h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.3;
}

.product-info .price-block {
    margin: 20px 0;
    padding: 20px;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.product-info .price-big {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--secondary);
}

.product-info .price-old-big {
    font-size: 1.2rem;
    color: var(--gray-500);
    text-decoration: line-through;
}

.product-details-table {
    width: 100%;
    margin: 20px 0;
}

.product-details-table tr td {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}

.product-details-table tr td:first-child {
    font-weight: 600;
    color: var(--gray-600);
    width: 140px;
}

.product-features {
    margin: 20px 0;
}

.product-features li {
    padding: 6px 0;
    font-size: 0.9rem;
    list-style: none;
    position: relative;
    padding-left: 20px;
}

.product-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* WhatsApp CTA */
.whatsapp-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--whatsapp);
    color: #fff;
    border-radius: var(--radius);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 25px 0;
    transition: var(--transition);
    text-align: center;
}

.whatsapp-cta:hover {
    background: #1da851;
    color: #fff;
    transform: scale(1.02);
}

.whatsapp-cta svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* WhatsApp floating button */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: var(--whatsapp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition);
}

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

.whatsapp-float svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

/* BREADCRUMB */
.breadcrumb {
    padding: 15px 0;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.breadcrumb a { color: var(--gray-600); }
.breadcrumb a:hover { color: var(--secondary); }
.breadcrumb span { margin: 0 8px; }

/* PAGINATION */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--white);
    color: var(--gray-700);
    box-shadow: var(--shadow);
}

.pagination a:hover { background: var(--gray-100); }
.pagination .active { background: var(--accent); color: #fff; }

/* FOOTER */
.site-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.7);
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 15px;
}

.footer-col p, .footer-col a {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 2;
}

.footer-col a:hover { color: var(--secondary); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* NO RESULTS */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.no-results h3 { margin-bottom: 10px; color: var(--gray-700); }

/* RESPONSIVE */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    
    .site-nav {
        display: none;
        position: absolute;
        top: 65px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    
    .site-nav.open { display: flex; }
    
    .hero h1 { font-size: 1.8rem; }
    .hero-search { flex-direction: column; }
    
    .product-single-grid { grid-template-columns: 1fr; }
    .product-gallery { position: static; }
    
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .product-card-body { padding: 12px; }
    .product-card-title { font-size: 0.9rem; }
    .product-price { font-size: 1rem; }
}

/* UTILITY */
.text-center { text-align: center; }
.mt-2 { margin-top: 20px; }
.mb-2 { margin-bottom: 20px; }
