﻿/* Estilos específicos para la página de detalle de producto de papelería */
.producto-detail-content {
    width: 100%;
}

.producto-title-container {
    margin-bottom: 20px;
}

.producto-title-detail {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    line-height: 1.3;
}

.producto-fabricante-detail {
    font-size: 18px;
    margin-bottom: 0px;
    margin-top: 0;
}

    .producto-fabricante-detail a {
        color: #0056b3;
        text-decoration: none;
    }

        .producto-fabricante-detail a:hover {
            text-decoration: underline;
        }

.producto-detail-layout {
    display: flex;
    gap: 30px;
}

.producto-gallery {
    flex: 0 0 40%;
    max-width: 40%;
    min-width: 280px;
}

/* CORREGIDO: Estilos del carousel */
.producto-carousel {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.producto-carousel-inner {
    position: relative;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f8f9fa;
    overflow: hidden;
}

.producto-carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .producto-carousel-item.active {
        display: flex;
        opacity: 1;
    }

    .producto-carousel-item img {
        max-height: 280px;
        max-width: 100%;
        object-fit: contain;
        cursor: zoom-in;
        transition: transform 0.3s ease;
    }

        .producto-carousel-item img:hover {
            transform: scale(1.05);
        }

/* CORREGIDO: Controles del carousel */
.producto-carousel-control-prev,
.producto-carousel-control-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    opacity: 0.7;
    transition: all 0.3s ease;
    z-index: 10;
}

.producto-carousel-control-prev {
    left: 15px;
}

.producto-carousel-control-next {
    right: 15px;
}

    .producto-carousel-control-prev:hover,
    .producto-carousel-control-next:hover {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.8);
        transform: translateY(-50%) scale(1.1);
    }

.producto-carousel-control-prev-icon,
.producto-carousel-control-next-icon {
    width: 20px;
    height: 20px;
    background-size: 100%;
    background-position: center;
    background-repeat: no-repeat;
}

.producto-carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

.producto-carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* NUEVO: Modal de zoom de imagen */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: zoom-out;
    animation: fadeIn 0.3s ease;
}

    .image-zoom-modal img {
        max-width: 90%;
        max-height: 90%;
        object-fit: contain;
        animation: zoomIn 0.3s ease;
    }

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
    }

    to {
        transform: scale(1);
    }
}

.detalles-tecnicos {
    margin-top: 20px;
}

    .detalles-tecnicos h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 15px;
        color: #333;
    }

.detalles-table {
    width: 100%;
    border-collapse: collapse;
}

    .detalles-table th,
    .detalles-table td {
        padding: 10px 0;
        border-bottom: 1px solid #e0e0e0;
        font-size: 14px;
        vertical-align: top;
    }

    .detalles-table th {
        width: 40%;
        text-align: left;
        font-weight: 600;
        color: #555;
    }

    .detalles-table td {
        color: #333;
    }

.producto-details {
    flex: 0 0 55%;
    max-width: 55%;
}

.producto-resumen {
    margin-bottom: 30px;
}

    .producto-resumen h3 {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 15px;
        color: #333;
    }

/* CORREGIDO: Estilos para descripción expandible */
.producto-description-content {
    line-height: 1.6;
    color: #444;
    font-size: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .producto-description-content.expanded {
        display: block;
        -webkit-line-clamp: unset;
        overflow: visible;
    }

/* CORREGIDO: Botón "Ver más" */
.ver-mas-btn {
    display: inline-block;
    margin-top: 10px;
    color: #0046BE;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

    .ver-mas-btn:hover {
        color: #003399;
        text-decoration: underline;
    }

.producto-price-container {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.producto-price-main {
    margin-bottom: 20px;
}

.producto-price-value {
    font-size: 28px;
    font-weight: 700;
    color: #000;
}

.producto-price-tax {
    font-size: 12px;
    color: #6c757d;
    display: block;
    margin-top: 5px;
}

.producto-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.producto-quantity {
    width: 80px;
    flex-shrink: 0;
}

.producto-quantity-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 25px;
    background-color: white;
    font-size: 14px;
    height: 45px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

    .producto-quantity-select:focus {
        outline: none;
        border-color: #0046BE;
        box-shadow: 0 0 0 2px rgba(0, 70, 190, 0.1);
    }

.producto-add-to-cart-btn {
    flex: 1;
    padding: 12px 20px;
    background-color: #ee1c25;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 45px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .libro-add-to-cart-btn:hover {
        background-color: #d71920;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(238, 28, 37, 0.3);
    }

    .libro-add-to-cart-btn:active {
        transform: translateY(0);
    }

.btn-disabled {
    flex: 1;
    padding: 12px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: not-allowed;
    height: 45px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.6;
}

/* Alerta para producto no disponible */
.producto-alert {
    position: relative;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    border-radius: 8px;
}

.producto-alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* NUEVO: Animación de carga para carousel */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.carousel-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
}

    .carousel-loading::after {
        content: '';
        width: 40px;
        height: 40px;
        border: 4px solid #f3f3f3;
        border-top: 4px solid #0046BE;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

/* NUEVO: Estilos para notificaciones del carrito */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.cart-notification-success {
    background-color: #28a745;
}

.cart-notification-error {
    background-color: #dc3545;
}

/* Media queries para diseño responsivo */
@media (max-width: 1200px) {
    .producto-detail-layout {
        gap: 20px;
    }

    .producto-gallery {
        flex: 0 0 45%;
        max-width: 45%;
    }

    .producto-details {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 992px) {
    .producto-detail-layout {
        flex-direction: column;
        gap: 30px;
    }

    .producto-gallery,
    .producto-details {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .producto-carousel {
        max-width: 400px;
    }

    .producto-carousel-inner {
        height: 250px;
    }

    .producto-carousel-item img {
        max-height: 230px;
    }
}

@media (max-width: 768px) {
    .producto-detail-container {
        padding-top: 25%;
    }

    .producto-actions {
        flex-direction: column;
        gap: 15px;
    }

    .producto-quantity {
        width: 100%;
    }

    .producto-title-detail {
        font-size: 20px;
    }

    .producto-fabricante-detail {
        font-size: 16px;
    }

    .producto-price-value {
        font-size: 24px;
    }

    .producto-carousel-control-prev,
    .producto-carousel-control-next {
        width: 40px;
        height: 40px;
    }

    .producto-carousel-control-prev {
        left: 10px;
    }

    .producto-carousel-control-next {
        right: 10px;
    }
}

@media (max-width: 576px) {
    .producto-carousel-inner {
        height: 200px;
    }

    .producto-carousel-item img {
        max-height: 180px;
    }

    .producto-price-container {
        padding: 15px;
    }

    .detalles-table th,
    .detalles-table td {
        font-size: 13px;
        padding: 8px 0;
    }
}
