/* ==========================================================================
   MejorVirtual - Estilos Globales para Laravel
   ========================================================================== */

:root {
    --primary-color: #0075EC;
    --primary-hover: #0060c4;
    --accent-cyan: #00C1ED;
    --accent-mint: #00b399;
    --accent-yellow: #d97706;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 117, 236, 0.15);
}

.header-container {
    max-width: 1140px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.3px;
}

/* Botón de Menú a la Izquierda del Header */
.btn-menu-drawer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.btn-menu-drawer:hover {
    background: rgba(255, 255, 255, 0.32);
}

.btn-menu-drawer:active {
    transform: scale(0.97);
}

/* Off-Canvas Drawer (Ventana Lateral Sobrepuesta con z-index) */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: 310px;
    max-width: 85vw;
    height: 100vh;
    background: #ffffff;
    z-index: 2001;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.drawer-panel.active {
    transform: translateX(0);
    visibility: visible;
}

.drawer-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-color);
}

.drawer-close-btn {
    background: #e2e8f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.drawer-close-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.drawer-body {
    padding: 20px 16px;
    flex: 1;
    overflow-y: auto;
}

.drawer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    font-size: 0.98rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: inherit;
}

.drawer-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.drawer-item.active {
    background: #e0f2fe;
    color: var(--primary-color);
    border-color: #bae6fd;
}

.search-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 20px;
    padding: 4px 14px;
    flex: 1;
    max-width: 380px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    padding: 6px 8px;
    font-size: 0.9rem;
    color: var(--text-color);
}

.search-bar button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-repair {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-mint);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,179,153,0.35);
}

.btn-repair:hover {
    transform: translateY(-2px);
    background-color: #009d87;
}

/* Main Container */
.container {
    max-width: 1140px;
    margin: 28px auto;
    padding: 0 20px;
}

/* ==========================================================================
   Navegación Principal por Pestañas (Tabs UX)
   ========================================================================== */
.main-tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.main-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 22px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
}

.main-tab-btn:hover {
    color: var(--primary-color);
    background-color: #f1f5f9;
}

.main-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #f0f7ff;
}

.tab-pane {
    display: none;
    animation: fadeInTab 0.25s ease-in-out;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeInTab {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Sección de Servicios en el Local
   ========================================================================== */

.services-section {
    margin-bottom: 40px;
}

.section-title-group {
    margin-bottom: 20px;
}

.section-title-group h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
}

.section-title-group p {
    font-size: 0.92rem;
    color: var(--text-muted);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 117, 236, 0.08);
    border-color: var(--accent-cyan);
}

.service-card.highlight {
    border: 2px solid var(--primary-color);
    background: linear-gradient(180deg, #ffffff 0%, #f0f7ff 100%);
}

.service-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background-color: #e0f2fe;
    color: var(--primary-color);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.service-badge.yellow {
    background-color: #fef3c7;
    color: var(--accent-yellow);
}

.service-badge.cyan {
    background-color: #e0f2fe;
    color: var(--accent-cyan);
}

.service-badge.mint {
    background-color: #e6fffa;
    color: var(--accent-mint);
}

.service-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.service-icon-box.blue { background-color: #eff6ff; }
.service-icon-box.yellow { background-color: #fffbe3; }
.service-icon-box.cyan { background-color: #ecfeff; }
.service-icon-box.mint { background-color: #f0fdfa; }

.service-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.service-card p {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    flex-grow: 1;
}

.btn-service {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-align: center;
}

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

.btn-service-outline {
    background-color: #ffffff;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-service-outline:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* ==========================================================================
   Catálogo de Productos
   ========================================================================== */

.catalog-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.catalog-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

.catalog-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.category-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.pill {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill:hover, .pill.active {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

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

.product-img {
    height: 160px;
    background-color: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

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

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

.product-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.btn-secondary {
    width: 100%;
    background-color: #f1f5f9;
    color: var(--text-color);
    border: none;
    padding: 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
}

/* ==========================================================================
   Sección de Información y Contacto
   ========================================================================== */

.contact-section {
    margin-top: 20px;
    margin-bottom: 40px;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.contact-icon {
    width: 48px;
    height: 48px;
    background-color: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.contact-icon.green { background-color: #e6fffa; }
.contact-icon.cyan { background-color: #ecfeff; }
.contact-icon.yellow { background-color: #fffbe3; }

.contact-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.contact-detail {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.contact-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.contact-link.green { color: var(--accent-mint); }
.contact-link.cyan { color: var(--accent-cyan); }

.contact-link:hover {
    text-decoration: underline;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 24px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.2s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal.modal-large {
    max-width: 720px;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.full-width {
    width: 100%;
}

/* Estilos de Detalle de Producto en Modal */
.product-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
}

@media (max-width: 640px) {
    .product-detail-layout {
        grid-template-columns: 1fr;
    }
}

.product-detail-image-box {
    background: #f1f5f9;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
}

.detail-big-img {
    max-width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 8px;
}

.detail-category-tag {
    display: inline-block;
    background: #e0f2fe;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 8px;
}

.detail-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.detail-description-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.detail-description-box h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.detail-description-box p {
    font-size: 0.88rem;
    color: var(--text-color);
    line-height: 1.4;
}

.detail-description-content {
    font-size: 0.88rem;
    color: var(--text-color);
    line-height: 1.5;
}

.detail-description-content p {
    margin: 0 0 8px 0;
}

.detail-description-content p:last-child {
    margin-bottom: 0;
}

.detail-description-content ul,
.detail-description-content ol {
    margin: 6px 0 10px 20px;
    padding: 0;
}

.detail-description-content ul {
    list-style-type: disc;
}

.detail-description-content ol {
    list-style-type: decimal;
}

.detail-description-content li {
    margin-bottom: 4px;
}

.detail-description-content strong {
    font-weight: 700;
    color: #0f172a;
}

.detail-description-content a {
    color: var(--primary-color);
    text-decoration: underline;
}

.detail-stock-info {
    font-size: 0.82rem;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-weight: 600;
}

.detail-delivery-info {
    font-size: 0.82rem;
    color: #0369a1;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.dot-green {
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #25d366;
    color: #ffffff;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
}

.whatsapp-btn:hover {
    background-color: #128c7e;
}

/* Footer */
.footer {
    background-color: #1e293b;
    color: #94a3b8;
    padding: 32px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-content strong {
    color: #ffffff;
}

.footer-sub {
    font-size: 0.85rem;
    margin-top: 4px;
    margin-bottom: 12px;
}

.footer-copy {
    font-size: 0.75rem;
    color: #64748b;
}

/* Botón Flotante de WhatsApp (Lado Derecho) */
.whatsapp-float-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #25d366;
    color: #ffffff;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.45);
    z-index: 999;
    text-decoration: none;
    transition: transform 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1);
    background-color: #128c7e;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-float-tooltip {
    position: absolute;
    right: 70px;
    left: auto;
    background-color: #1e293b;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.whatsapp-float-btn:hover .whatsapp-float-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Media Queries */
@media (max-width: 640px) {
    .container {
        padding: 0 10px;
        margin: 16px auto;
    }

    .header-container {
        align-items: center;
        gap: 12px;
    }
    .search-bar {
        max-width: 100%;
        order: 3;
        width: 100%;
    }
    .header-actions {
        justify-content: center;
    }
    .catalog-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 16px;
    }

    /* Grilla de 2 productos por fila en celular */
    .products-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .product-card {
        padding: 10px !important;
        border-radius: 10px;
        box-sizing: border-box;
        min-width: 0;
    }

    .product-img {
        height: 120px !important;
        margin-bottom: 8px;
    }

    .product-title {
        font-size: 0.8rem !important;
        line-height: 1.25;
        margin-bottom: 4px;
        min-height: 2.5em;
    }

    .product-price {
        font-size: 0.92rem !important;
        font-weight: 800;
        margin-bottom: 8px;
    }

    .btn-secondary {
        padding: 8px 4px !important;
        font-size: 0.72rem !important;
        letter-spacing: -0.2px;
    }
}
