/* Estilos específicos de producto_detalle.php */

body { background: #f4f6fa; font-family: 'Poppins', Arial, sans-serif; }
.breadcrumb { background: none; font-size: 1rem; }

/* Menú superior */
.top-menu {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.top-menu-left, .top-menu-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.top-menu-right { justify-content: flex-end; }

.top-menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.top-menu-link:hover {
    color: #0d6efd;
    background: #f8f9fa;
    text-decoration: none;
}

.top-menu-item { position: relative; }
.top-menu-item .top-menu-link { cursor: pointer; }

.top-submenu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    pointer-events: auto;
}

.top-menu-item:hover .top-submenu,
.top-submenu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.top-submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #495057;
    text-decoration: none;
    border-bottom: 1px solid #f8f9fa;
    transition: background 0.2s ease;
    cursor: pointer;
    position: relative;
    z-index: 10000;
    user-select: none;
}

.top-submenu-item:last-child { border-bottom: none; }

.top-submenu-item:hover {
    background: #f8f9fa;
    color: #0d6efd;
    text-decoration: none;
}

.top-submenu-item i { width: 16px; text-align: center; }

@media (max-width: 768px) {
    .top-menu { padding: 8px 0; }
    .top-menu-left, .top-menu-right { gap: 10px; }
    .top-menu-link { font-size: 0.9rem; padding: 6px 8px; }
    .top-menu-link span { display: none; }
    .top-menu-link i { font-size: 1.1rem; }
    .top-submenu { right: -10px; min-width: 180px; }
}

/* Galería de imágenes */
.product-gallery { display: flex !important; flex-direction: row !important; gap: 24px; margin-bottom: 32px; }
.thumbnail-gallery { display: flex !important; flex-direction: column !important; gap: 12px; width: 90px; flex-shrink: 0; }
.thumbnail { width: 80px; height: 80px; object-fit: cover; border: 2px solid #eee; border-radius: 10px; cursor: pointer; transition: border 0.2s, box-shadow 0.2s; background: #fff; }
.thumbnail.active, .thumbnail:hover { border-color: #0d6efd; box-shadow: 0 0 8px #0d6efd33; }
.main-image-container { flex: 1 !important; position: relative; max-width: 520px; height: 420px; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 4px 24px rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center; }
.main-image { width: 100%; height: 100%; object-fit: contain; transition: transform 0.25s ease-out; cursor: zoom-in; }
.main-image-container.zooming .main-image { transform: scale(2.2); transition: transform 0.15s ease-out; }
.zoom-hint { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.55); color: #fff; font-size: 0.78rem; padding: 5px 14px; border-radius: 20px; pointer-events: none; white-space: nowrap; opacity: 1; transition: opacity 0.3s; z-index: 5; }
.main-image-container.zooming .zoom-hint { opacity: 0; }
@media (hover: none) { .zoom-hint { display: none; } }

/* Modal de zoom */
.image-zoom-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.image-zoom-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%; height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-zoom-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    cursor: zoom-in;
    transition: transform 0.2s ease-out;
}

.image-zoom-img.zoomed { transform: scale(2.5); cursor: zoom-out; }

.image-zoom-close {
    position: absolute;
    top: 15px; right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
}

.image-zoom-close:hover, .image-zoom-close:focus { color: #bbb; text-decoration: none; }

.image-zoom-nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none; border-radius: 50%;
    width: 50px; height: 50px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: white; font-size: 24px;
    transition: background 0.3s;
}

.image-zoom-nav:hover { background: rgba(255,255,255,0.3); }
.image-zoom-nav.prev { left: 20px; }
.image-zoom-nav.next { right: 20px; }

@media (max-width: 768px) {
    .image-zoom-content { padding: 10px; width: 95%; height: 95%; }
    .image-zoom-close { top: 10px; right: 20px; font-size: 30px; }
    .image-zoom-nav { width: 40px; height: 40px; font-size: 18px; }
    .image-zoom-nav.prev { left: 10px; }
    .image-zoom-nav.next { right: 10px; }
}

.image-nav { position: absolute; top: 50%; transform: translateY(-50%); background: #fff; border: none; border-radius: 50%; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px #0001; font-size: 20px; color: #0d6efd; z-index: 2; }
.image-nav.prev { left: 10px; }
.image-nav.next { right: 10px; }
.image-nav:active { background: #e9ecef; }

/* Información del producto */
.product-info { background: #fff; padding: 32px 28px; border-radius: 16px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); margin-bottom: 32px; }
.product-title { font-size: 1.5rem; font-weight: 700; color: #222; margin-bottom: 10px; }
.product-category { display: inline-block; background: #0d6efd; color: #fff; padding: 5px 18px; border-radius: 20px; font-size: 0.5rem; margin-bottom: 18px; }

.product-description {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
    border-left: 4px solid #0d6efd;
}

.description-title {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.description-title i { color: #0d6efd; }

.description-content { color: #555; line-height: 1.8; font-size: 0.8rem; text-align: justify; }
.description-content p { margin-bottom: 12px; }
.description-content p:last-child { margin-bottom: 0; }

@media (max-width: 768px) {
    .product-description { padding: 15px; margin-bottom: 20px; }
    .description-title { font-size: 1rem; margin-bottom: 12px; }
    .description-content { font-size: 0.95rem; line-height: 1.6; }
}

.product-additional-info { margin-top: 20px; padding-top: 20px; border-top: 1px solid #eee; }
.additional-info-title { font-size: 1.2rem; font-weight: 600; color: #333; margin-bottom: 10px; }
.additional-info-content { color: #666; line-height: 1.6; font-size: 0.75rem; }

/* Selector de cantidad y botones */
.quantity-selector { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; }
.quantity-btn { width: 42px; height: 42px; border: 2px solid #eee; background: #f8f9fa; border-radius: 10px; font-size: 20px; color: #0d6efd; cursor: pointer; transition: border 0.2s, background 0.2s; }
.quantity-btn:hover { border-color: #0d6efd; background: #e9ecef; }
.quantity-input { width: 70px; height: 42px; text-align: center; border: 2px solid #eee; border-radius: 10px; font-size: 1.1rem; }
.add-to-cart-btn { background: linear-gradient(90deg, #0d6efd 60%, #0056b3 100%); color: #fff; border: none; padding: 15px 0; border-radius: 10px; font-size: 1.1rem; font-weight: 600; cursor: pointer; width: 100%; margin-bottom: 12px; box-shadow: 0 2px 8px #0d6efd22; transition: background 0.2s; }
.add-to-cart-btn:hover { background: linear-gradient(90deg, #0056b3 60%, #0d6efd 100%); }
.add-to-cart-btn:disabled { background: #6c757d; cursor: not-allowed; box-shadow: none; }
.add-to-cart-btn:disabled:hover { background: #6c757d; }
.whatsapp-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(90deg, #25d366 60%, #1ebe5d 100%); color: #fff; border: none; padding: 15px 0; border-radius: 10px; font-size: 1.1rem; font-weight: 600; cursor: pointer; width: 100%; margin-bottom: 12px; box-shadow: 0 2px 8px #25d36633; transition: background 0.2s; text-decoration: none; }
.whatsapp-btn:hover { background: linear-gradient(90deg, #1ebe5d 60%, #25d366 100%); color: #fff; }
.whatsapp-btn i { font-size: 1.4rem; }
.text-muted small { color: #888 !important; }

/* Productos relacionados */
.related-products { margin-top: 48px; }
.related-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 24px; color: #222; }
.product-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 12px #0001; transition: transform 0.2s, box-shadow 0.2s; text-decoration: none; color: inherit; display: block; }
.product-card:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 8px 32px #0d6efd22; }
.product-card img { width: 100%; height: 180px; object-fit: cover; }
.product-card-body { padding: 18px; }
.product-card-title { font-weight: 600; margin-bottom: 8px; color: #222; font-size: 1.1rem; }
.product-card-price { color: #28a745; font-weight: 700; font-size: 1.1rem; }

@media (max-width: 991px) {
    .product-gallery { flex-direction: row; align-items: flex-start; }
    .main-image-container { max-width: calc(100% - 110px); height: 320px; }
    .thumbnail-gallery { flex-direction: column; width: 90px; margin-bottom: 0; }
}
@media (max-width: 600px) {
    .product-info { padding: 18px 8px; }
    .main-image-container { height: 220px; max-width: calc(100% - 100px); }
    .product-title { font-size: 1.3rem; }
    .thumbnail-gallery { width: 80px; }
    .thumbnail { width: 70px; height: 70px; }
}

/* Carrito lateral */
.cart-section { transform: translateX(100%); transition: transform 0.3s ease; }
.cart-section.open { transform: translateX(0); }

/* Sidebar responsive */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -320px; top: 0;
        height: 100vh; width: 320px;
        z-index: 1050;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 0 20px rgba(0,0,0,0.3);
    }
    .sidebar.active {
        left: 0;
        animation: sidebarSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .sidebar-overlay {
        position: fixed; top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.6);
        z-index: 1040; display: none;
        backdrop-filter: blur(2px);
    }
    .sidebar.active ~ .sidebar-overlay { display: block; }
    .hamburger-btn {
        display: flex !important;
        position: fixed; top: 20px; left: 20px;
        z-index: 1060;
        background: #001f3f; border: none;
        border-radius: 16px; padding: 12px;
        box-shadow: 0 4px 16px rgba(102,126,234,0.4);
        color: #fff; transition: all 0.3s ease;
        cursor: pointer; min-width: 48px; min-height: 48px;
        align-items: center; justify-content: center;
    }
    .hamburger-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,0.6); }
    .hamburger-btn i { font-size: 18px; color: #fff; }
}

@media (min-width: 992px) {
    .dashboard { display: flex; flex-direction: row; }
    .sidebar {
        position: relative; width: 280px; min-width: 280px;
        height: 100vh; left: 0; transform: none;
        transition: all 0.3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15); z-index: auto;
    }
    .sidebar.active { left: 0; transform: none; box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
    .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 0; flex: 1; }
    .hamburger-btn {
        display: flex !important;
        position: fixed; top: 20px; left: 20px;
        z-index: 1060;
        background: #001f3f; border: none;
        border-radius: 16px; padding: 12px;
        box-shadow: 0 4px 16px rgba(102,126,234,0.4);
        color: #fff; transition: all 0.3s ease;
        cursor: pointer; min-width: 48px; min-height: 48px;
        align-items: center; justify-content: center;
    }
    .hamburger-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,0.6); }
    .hamburger-btn i { font-size: 18px; color: #fff; }
}

@keyframes sidebarSlideIn {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(0); }
}

/* Items del carrito compactos */
.remove-item { width: 18px !important; height: 18px !important; font-size: 7px !important; }
.cotizacion-badge { padding: 3px 6px !important; font-size: 9px !important; }
.summary-header h5 { font-size: 12px !important; }
.info-item span { font-size: 10px !important; }
.cta-message { font-size: 11px !important; }
.cotizacion-btn { font-size: 11px !important; padding: 6px 12px !important; }

.cotizacion-benefits {
    background: white; border-radius: 8px; padding: 12px;
    margin-bottom: 12px; border: 1px solid #dee2e6;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.benefit-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f8f9fa; }
.benefit-item:last-child { border-bottom: none; }
.benefit-item i { font-size: 1rem; width: 20px; text-align: center; }
.benefit-item div { flex: 1; }
.benefit-item strong { display: block; color: #495057; font-size: 11px; margin-bottom: 1px; }
.benefit-item small { color: #6c757d; font-size: 9px; }

.cotizacion-cta {
    text-align: center;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 8px; padding: 12px; color: white;
}

.cta-message {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; margin-bottom: 8px; font-size: 12px; font-weight: 600;
}

.cta-message i { font-size: 1rem; animation: pulse 2s infinite; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cotizacion-btn {
    background: white !important; color: #28a745 !important;
    border: 2px solid white !important; font-weight: 700 !important;
    font-size: 12px !important; padding: 8px 16px !important;
    border-radius: 15px !important; box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
    transition: all 0.3s ease !important; text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

.cotizacion-btn:hover {
    background: #f8f9fa !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3) !important;
}

.cotizacion-btn i { margin-right: 4px; font-size: 0.9rem; }

.empty-cart-benefits {
    display: flex; justify-content: center;
    gap: 12px; margin-top: 12px; flex-wrap: wrap;
}

.benefit-mini {
    display: flex; flex-direction: column;
    align-items: center; gap: 3px;
    padding: 6px; background: #f8f9fa;
    border-radius: 6px; min-width: 60px;
}

.benefit-mini i { font-size: 1.2rem; }
.benefit-mini span { font-size: 9px; font-weight: 600; color: #495057; text-align: center; }

/* Items del carrito */
.cart-item { padding: 8px !important; margin-bottom: 6px !important; border-radius: 8px !important; background: white !important; box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important; }
.cart-item-image { width: 40px !important; height: 40px !important; border-radius: 6px !important; object-fit: cover !important; }
.cart-item-name { font-size: 11px !important; font-weight: 600 !important; margin-bottom: 4px !important; line-height: 1.2 !important; color: #495057 !important; }
.cart-item-actions { display: flex !important; align-items: center !important; justify-content: space-between !important; gap: 8px !important; }
.quantity-control { display: flex !important; align-items: center !important; gap: 4px !important; }
.quantity-btn { width: 20px !important; height: 20px !important; border: 1px solid #ddd !important; background: white !important; border-radius: 4px !important; font-size: 10px !important; display: flex !important; align-items: center !important; justify-content: center !important; }
.quantity { font-size: 11px !important; font-weight: 600 !important; padding: 0 6px !important; color: #495057 !important; }
.remove-item { width: 20px !important; height: 20px !important; border: none !important; background: #dc3545 !important; color: white !important; border-radius: 50% !important; font-size: 8px !important; display: flex !important; align-items: center !important; justify-content: center !important; }

.cart-items-list { max-height: 300px !important; overflow-y: auto !important; padding-right: 4px !important; }
.cart-items-list::-webkit-scrollbar { width: 4px !important; }
.cart-items-list::-webkit-scrollbar-track { background: #f1f1f1 !important; border-radius: 2px !important; }
.cart-items-list::-webkit-scrollbar-thumb { background: #c1c1c1 !important; border-radius: 2px !important; }
.cart-items-list::-webkit-scrollbar-thumb:hover { background: #a8a8a8 !important; }

/* === Mobile-first producto detalle === */
.desc-toggle {
    display: flex; align-items: center; gap: 8px;
    width: 100%; background: #f8f9fa;
    border: 1px solid #dee2e6; border-radius: 10px;
    padding: 12px 16px; font-size: 0.95rem;
    font-weight: 600; color: #333; cursor: pointer; margin-bottom: 0;
}
.desc-toggle .chevron { margin-left: auto; transition: transform 0.25s; }
.desc-toggle.open .chevron { transform: rotate(180deg); }

@media (max-width: 767.98px) {
    .desc-collapsible { display: none; }
    .desc-collapsible.open { display: block; border-radius: 0 0 12px 12px; }
    .sticky-actions {
        position: fixed; bottom: 0; left: 0; right: 0;
        z-index: 1030; background: #fff;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 16px rgba(0,0,0,0.13);
        display: flex; gap: 10px;
    }
    .sticky-actions .add-to-cart-btn,
    .sticky-actions .whatsapp-btn { margin-bottom: 0; flex: 1; padding: 13px 0; font-size: 1rem; }
    .action-zone .add-to-cart-btn,
    .action-zone .whatsapp-btn { display: none; }
    .product-info { padding-bottom: 90px !important; }
}

@media (min-width: 768px) {
    .sticky-actions { display: none !important; }
    .desc-toggle { display: none !important; }
}

/* Paginación responsive */
@media (max-width: 768px) {
    .pagination-info .row { text-align: center; }
    .pagination-info .col-md-6:last-child { margin-top: 10px; }
    .pagination-controls { justify-content: center; }
    .pagination-controls .btn { min-width: 35px; height: 32px; font-size: 12px; }
    .pagination .page-link { padding: 6px 10px; font-size: 12px; }
    .cotizacion-benefits { padding: 10px; }
    .benefit-item { padding: 5px 0; }
    .benefit-item i { font-size: 0.9rem; width: 18px; }
    .benefit-item strong { font-size: 10px; }
    .benefit-item small { font-size: 8px; }
    .empty-cart-benefits { gap: 10px; }
    .benefit-mini { min-width: 55px; padding: 5px; }
    .benefit-mini i { font-size: 1rem; }
    .benefit-mini span { font-size: 8px; }
    .cart-item { padding: 6px !important; margin-bottom: 4px !important; }
    .cart-item-image { width: 35px !important; height: 35px !important; }
    .cart-item-name { font-size: 10px !important; }
    .quantity-btn { width: 18px !important; height: 18px !important; font-size: 9px !important; }
    .quantity { font-size: 10px !important; }
    .remove-item { width: 18px !important; height: 18px !important; font-size: 7px !important; }
    .cotizacion-badge { padding: 3px 6px !important; font-size: 9px !important; }
    .summary-header h5 { font-size: 12px !important; }
    .info-item span { font-size: 10px !important; }
    .cta-message { font-size: 11px !important; }
    .cotizacion-btn { font-size: 11px !important; padding: 6px 12px !important; }
}
