/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

/* Contenedor principal */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Breadcrumb */
.breadcrumb {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.breadcrumb-item {
    display: inline-block;
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #333;
}

/* Layout del producto */
.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

/* Galería de imágenes */
.product-gallery {
    position: relative;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.carousel-slides {
    display: flex;
    transition: transform 0.3s ease;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
}

.carousel-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    cursor: zoom-in;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
}

.carousel-nav.prev {
    left: 10px;
}

.carousel-nav.next {
    right: 10px;
}

.carousel-nav svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.carousel-indicator.active {
    background: #007bff;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.active,
.thumbnail:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

/* Información del producto */
.product-info {
    padding: 0 20px;
}

.product-header {
    margin-bottom: 20px;
}

.product-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a1a1a;
}

.security-section {
    margin-bottom: 20px;
}

.security-title {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.security-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stars .star {
    font-size: 1.2rem;
    color: #ccc;
}

.stars .star.filled {
    color: #f5a623;
}

.rating-text {
    font-size: 0.9rem;
    color: #555;
}

/* Formulario de compra */
.purchase-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.form-select,
.qty-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.form-select:focus,
.qty-input:focus {
    border-color: #007bff;
    outline: none;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease;
}

.qty-btn:hover {
    background: #0056b3;
}

.qty-input {
    width: 60px;
    text-align: center;
}
.qty-input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}


.stock-status {
    font-size: 0.85rem;
    margin-top: 10px;
    color: #555;
}

.stock-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
}

.price-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.price-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.price-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #007bff;
}

/* ===== NUEVOS ESTILOS Y MODIFICACIONES ===== */

/* Controles de compra (Añadir/Consultar) */
.purchase-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

/* Estado de stock */
.stock-status-inline {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}
.stock-status-inline .stock-text {
    font-weight: 600;
}
.stock-status-inline i {
    margin-right: 8px;
    font-size: 1.1rem;
}
.stock-status-inline.in-stock {
    color: #28a745; /* Verde */
}
.stock-status-inline.out-stock {
    color: #17a2b8; /* Azul info */
}
.text-success { color: #28a745; }
.text-info { color: #17a2b8; }


/* Botón de añadir al carrito y consultar */
.btn-add-to-cart,
.btn-request-product {
    min-width: 180px;
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}
.btn-add-to-cart:hover:not(:disabled),
.btn-request-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-add-to-cart:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

.btn-request-product {
    background-color: #6c757d;
    color: #fff;
    border: none;
}
.btn-request-product:hover {
    background-color: #5a6268;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
/* ===== FIN DE NUEVOS ESTILOS Y MODIFICACIONES ===== */


.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary {
    background: #007bff;
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
    border: none;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}


/* Descripción del producto */
.product-description {
    margin-top: 40px;
}

.description-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.description-content p,
.description-content ul,
.description-content ol {
    margin-bottom: 15px;
}

.description-content h3,
.description-content h4 {
    margin-bottom: 10px;
}

/* Sección de comentarios */
.product-comments {
    margin-top: 40px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.product-comments h2#comments-title {
    font-size: 1.9rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
    padding-bottom: 12px;
    border-bottom: 3px solid #007bff;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}
.no-comments {
    font-size: 1.1rem;
    color: #6c757d;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.comment {
    background: #fdfdff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
    border-left: 5px solid #007bff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comment:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.comment-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.comment-author {
    font-weight: 600;
    font-size: 1.2rem;
    color: #1a1a1a;
}
.comment-rating .star {
    font-size: 1.3rem;
    color: #dee2e6;
}
.comment-rating .star.filled {
    color: #f5a623;
}

.comment-date {
    font-size: 0.9rem;
    color: #6c757d;
}

.comment-text {
    font-size: 1rem;
    color: #333;
    line-height: 1.8;
    margin-top: 15px;
}

/* Botón Editar y Formulario de Edición */
.btn-edit-comment {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-left: auto;
}
.btn-edit-comment:hover {
    background: #5a6268;
}
.btn-edit-comment i {
    margin-right: 5px;
}

.edit-comment-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-top: 15px;
}
.edit-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Formulario para añadir comentario */
.comment-form {
    margin-top: 40px;
    padding: 30px;
    background: #fdfdff;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
    border-top: 2px solid #007bff;
}
.comment-form h3 {
    margin-bottom: 25px;
}
.comment-form .required {
    color: #dc3545;
}
.comment-form textarea {
    resize: vertical;
    min-height: 140px;
}
.comment-form .checkbox-label {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}
.comment-form input[type="checkbox"] {
    margin-right: 12px;
    accent-color: #007bff;
}
.comment-message {
    font-size: 1rem;
    color: #555;
    background: #e9ecef;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-top: 20px;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
    line-height: 1;
}
.modal-close:hover {
    color: #333;
}

.zoom-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    padding: 0;
    background: transparent;
}

.zoom-modal img {
    width: auto;
    height: auto;
    max-width: 90vw;
    max-height: 90vh;
    display: block;
}

/* Notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
}
.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    animation-name: notificationProgress;
    animation-timing-function: linear;
}

/* Responsive */
@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
    .purchase-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    .stock-status-inline {
        justify-content: center;
    }
    .btn-add-to-cart,
    .btn-request-product {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .main-container {
        padding: 10px;
    }

    .product-title {
        font-size: 1.5rem;
    }
    .product-comments {
        padding: 15px;
    }
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .btn-edit-comment {
        align-self: flex-end;
        margin-top: 10px;
    }
}
