/* Estilos adicionales para detalle de libro mejorado */

/* Información del libro */
.book-details {
    background: #f8f9fa;
    padding: 1.2rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--color-primary, #007bff);
    margin-bottom: 1.5rem;
}

.book-details p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.book-details i {
    width: 18px;
    margin-right: 0.6rem;
    color: var(--color-primary, #007bff);
    font-size: 0.9rem;
}

/* Condición del libro */
.book-condition {
    margin-bottom: 1rem;
}

.book-condition .badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

/* Información de colección */
.collection-info {
    margin-bottom: 1.5rem;
}

.collection-info .badge {
    font-size: 0.95rem;
    padding: 0.7rem 1.2rem;
    background: #2c5aa0;
    border: 2px solid #1e4080;
    color: #ffffff;
    font-weight: 600;
    border-radius: 1.5rem;
    box-shadow: 0 3px 8px rgba(44,90,160,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Sección de precio mejorada */
.price-section {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.price-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    flex-direction: column;
}

.price-original {
    font-size: 1.1rem;
    text-decoration: line-through;
    color: #6c757d;
    font-weight: 500;
    text-align: center;
    margin-bottom: 0.5rem;
    display: block;
    width: 100%;
}

/* Badge de precio estilo expandido */
.price-badge {
    display: block;
    background: linear-gradient(135deg, #6c5ce7, #a55eea);
    color: #ffffff;
    font-size: 1.8rem;
    font-weight: 700;
    padding: 0.8rem 2rem;
    border-radius: 2rem;
    border: 2px solid #5b4cdb;
    box-shadow: 0 4px 12px rgba(108,92,231,0.35);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    line-height: 1.2;
    letter-spacing: 0.5px;
    text-align: center;
    min-width: 200px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.price-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108,92,231,0.45);
}

.price-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.price-badge:hover::before {
    left: 100%;
}

/* Precio highlight legacy (mantener por compatibilidad) */
.price-highlight {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c5aa0;
    text-shadow: 0 1px 3px rgba(44,90,160,0.3);
    /* Fallback para navegadores que no soportan background-clip */
}

/* Gradiente de texto para navegadores modernos */
@supports (-webkit-background-clip: text) {
    .price-highlight {
        background: linear-gradient(135deg, #2c5aa0, #1e4080);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        text-shadow: none;
    }
}

.discount-badge {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    font-size: 0.9rem;
    padding: 0.5rem 0.9rem;
    border-radius: 1.5rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(220,53,69,0.4);
    border: 2px solid #fff;
}

/* Información de disponibilidad mejorada */
.availability-info {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.availability-info .badge {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 1.5rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 120px;
    justify-content: center;
    flex: 0 0 auto;
}

.availability-info .badge i {
    font-size: 0.8rem;
}

/* Badges de stock */
.badge.bg-success {
    background: #28a745 !important;
    color: #ffffff !important;
    border: 2px solid #1e7e34;
    box-shadow: 0 2px 8px rgba(40,167,69,0.25);
    font-weight: 600;
}

.badge.bg-warning {
    background: #ffc107 !important;
    color: #212529 !important;
    border: 2px solid #d39e00;
    box-shadow: 0 2px 8px rgba(255,193,7,0.25);
    font-weight: 600;
}

.badge.bg-secondary {
    background: #6c757d !important;
    color: #ffffff !important;
    border: 2px solid #545b62;
    box-shadow: 0 2px 8px rgba(108,117,125,0.25);
    font-weight: 600;
}

/* Rating mejorado */
.rating-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.rating-section .stars {
    font-size: 1.4rem;
    margin-right: 0.75rem;
}

.rating-section .icon-star,
.rating-section .icon-star-half {
    margin-right: 0.15rem;
    filter: drop-shadow(0 1px 2px rgba(255,193,7,0.3));
    transition: transform 0.2s ease;
}

.rating-section .icon-star:hover,
.rating-section .icon-star-half:hover {
    transform: scale(1.1);
}

.rating-text strong {
    font-size: 1.1rem;
    color: #495057;
}

.rating-section .btn-outline-primary {
    border-radius: 1.5rem;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.rating-section .btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,123,255,0.3);
}

/* Descripción mejorada */
.description {
    background: #fff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border-left: 4px solid #17a2b8;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Etiquetas mejoradas */
.tags {
    margin-bottom: 1.5rem;
}

.tags .badge {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.9rem;
    border: 2px solid #dee2e6;
    border-radius: 1.2rem;
    transition: all 0.3s ease;
}

.tags .badge:hover {
    background: #e9ecef;
    color: #343a40;
    border-color: #adb5bd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Notas especiales mejoradas */
.special-notes .alert {
    border: none;
    border-left: 4px solid #17a2b8;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #d1ecf1, #bee5eb);
    box-shadow: 0 2px 8px rgba(23,162,184,0.2);
}

.special-notes h6 {
    color: #0c5460;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Dedicatorias mejoradas */
.dedications .alert {
    border: none;
    border-left: 4px solid #6c757d;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    box-shadow: 0 2px 8px rgba(108,117,125,0.2);
}

.dedications h6 {
    color: #495057;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

/* Botones de acción mejorados */
.action-buttons {
    padding: 2rem 0 1rem 0;
    border-top: 2px solid #e9ecef;
    margin-top: 2rem;
}

.action-buttons .btn {
    min-width: 160px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-bottom: 0.75rem;
}

.action-buttons .btn-primary {
    background: #2c5aa0;
    border: 2px solid #1e4080;
    color: #ffffff;
    font-weight: 600;
}

.action-buttons .btn-primary:hover {
    background: #1e4080;
    border-color: #164268;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44,90,160,0.4);
}

.action-buttons .btn-outline-dark {
    border: 2px solid #495057;
    color: #495057;
    background: #ffffff;
    font-weight: 600;
}

.action-buttons .btn-outline-dark:hover {
    background: #495057;
    color: #ffffff;
    border-color: #495057;
    transform: translateY(-2px);
}

.action-buttons .btn-outline-info {
    border: 2px solid #17a2b8;
    color: #0c5460;
    background: #ffffff;
    font-weight: 600;
}

.action-buttons .btn-outline-info:hover {
    background: #17a2b8;
    color: #ffffff;
    border-color: #17a2b8;
    transform: translateY(-2px);
}

/* Información adicional */
.additional-info {
    border-top: 1px solid #e9ecef;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

/* Badges personalizados mejorados */
.badge-outline-info {
    color: #0c5460;
    border: 2px solid #17a2b8;
    background: #f0fdff;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(23,162,184,0.15);
}

.badge-outline-secondary {
    color: #495057;
    border: 2px solid #6c757d;
    background: #f8f9fa;
    padding: 0.5rem 1rem;
    border-radius: 1.5rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(108,117,125,0.15);
}

/* Responsive mejorado */
@media (max-width: 768px) {
    .book-details {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .price-section {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .price-highlight {
        font-size: 1.8rem;
    }
    
    .price-current {
        font-size: 2.5rem !important;
    }
    
    .book-title {
        font-size: 2rem !important;
    }
    
    .book-author {
        font-size: 1.1rem !important;
    }
    
    .price-current {
        font-size: 2rem !important;
    }
    
    .price-main-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .btn-add-cart, .btn-shipping {
        width: 100%;
    }
    
    .service-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .book-figure-compact {
        max-width: 100%;
        margin-bottom: 1rem;
    }
    
    .book-details-compact {
        padding-left: 0;
    }
    
    .price-container {
        gap: 0.75rem;
        justify-content: center;
        text-align: center;
        width: 100%;
    }
    
    .availability-info {
        gap: 0.75rem;
        justify-content: center;
        flex-direction: row;
        align-items: center;
        width: 100%;
    }
    
    .availability-info .badge {
        min-width: 140px;
        justify-content: center;
        flex: 1 1 auto;
        max-width: 180px;
    }
    
    .action-buttons {
        padding: 1.5rem 0 1rem 0;
    }
    
    .action-buttons .d-flex {
        flex-direction: column;
        gap: 1rem !important;
    }
    
    .action-buttons .btn {
        min-width: auto;
        width: 100%;
        margin-bottom: 0;
    }
    
    .collection-info {
        text-align: center;
    }
    
    .collection-info .badge {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }
    
    .rating-section {
        padding: 1rem;
    }
    
    .rating-section .d-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .rating-section .btn-outline-primary {
        align-self: center;
    }
    
    .tags {
        text-align: center;
    }
    
    .book-condition {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .price-highlight {
        font-size: 1.6rem;
    }
    
    .price-current {
        font-size: 2.2rem !important;
    }
    
    .book-title {
        font-size: 1.8rem !important;
    }
    
    .book-author {
        font-size: 1rem !important;
    }
    
    .price-current {
        font-size: 2rem !important;
    }
    
    .novelty-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    .btn-add-cart, .btn-shipping {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .book-figure-compact img {
        max-width: 240px;
    }
    
    .price-container {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .availability-info {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .availability-info .badge {
        min-width: 200px;
        max-width: 250px;
        margin: 0 auto;
    }
    
    .discount-badge {
        align-self: center;
    }
    
    .book-details {
        padding: 0.75rem;
    }
    
    .rating-section .stars {
        font-size: 1.2rem;
    }
}

/* Animaciones mejoradas */
.badge, .alert, .btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.badge:hover {
    transform: translateY(-1px);
}

/* Mejoras visuales adicionales */
.book-card img {
    transition: transform 0.3s ease;
    border-radius: 0.5rem;
}

.book-card:hover img {
    transform: scale(1.02);
}

/* Estados de iconos */
.icon-star.text-warning {
    color: #ffc107 !important;
    text-shadow: 0 1px 2px rgba(255,193,7,0.3);
}

.icon-star-half.text-warning {
    color: #ffc107 !important;
    text-shadow: 0 1px 2px rgba(255,193,7,0.3);
}

/* Espaciado general mejorado */
.book-condition, .collection-info, .price-section, .rating-section, .description, .tags, .special-notes, .dedications {
    margin-bottom: 1.5rem;
}

/* Microinteracciones y accesibilidad */
.btn:focus, .badge:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.badge {
    cursor: default;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.btn:active::before {
    width: 200px;
    height: 200px;
}

/* Estados de loading para botones */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estilos minimalistas para diseño limpio */
.book-title {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

.book-author {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

.price-section-simple {
    background: #ffffff;
    padding: 2rem 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.price-current {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    letter-spacing: -1px;
}

.price-original-simple {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

.discount-info {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

.breadcrumb {
    font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/" !important;
    color: #6c757d;
}

/* Estilos para diseño compacto */
.book-figure-compact {
    max-width: 300px;
    margin: 0 auto;
}

.book-figure-compact img {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.book-details-compact {
    padding-left: 1rem;
}

/* Sección de precio profesional compacta */
.product-price-section {
    background: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.novelty-badge {
    display: inline-block;
    background: #ff9500;
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.price-container {
    margin-bottom: 1rem;
}

.price-original {
    color: #999;
    text-decoration: line-through;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.price-main-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
}

.price-current {
    font-size: 2.2rem;
    font-weight: 700;
    color: #28a745;
    line-height: 1;
}

.discount-badge {
    background: #28a745;
    color: white;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    border-radius: 4px;
}

/* Contenedor para alinear precio y cantidad */
.price-quantity-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1rem;
}

/* Selector de cantidad */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
    margin-top: 0;
    width: fit-content;
}

.qty-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #e9ecef;
}

.qty-minus {
    border-radius: 4px 0 0 4px;
}

.qty-plus {
    border-radius: 0 4px 4px 0;
}

.qty-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-left: none;
    border-right: none;
    outline: none;
    font-weight: 600;
}

/* Botones de acción principales compactos */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-add-cart {
    background: #067591;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-add-cart:hover:not(.disabled) {
    background: #055a6f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 117, 145, 0.3);
}

.btn-add-cart.disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-shipping {
    background: white;
    color: #333;
    border: 2px solid #dee2e6;
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-shipping:hover {
    border-color: #067591;
    color: #067591;
}

/* Servicios adicionales compactos */
.additional-services {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: #555;
    font-size: 0.85rem;
}

.service-icon {
    color: #067591;
    width: 20px;
    text-align: center;
}

.service-arrow {
    margin-left: auto;
    color: #067591;
}

/* Espaciado compacto */
.ftco-section {
    padding: 1rem 0 3rem 0;
}

/* Reducir espaciado entre secciones */
.book-details-compact .mb-3 {
    margin-bottom: 1rem !important;
}

.book-details-compact .mb-2 {
    margin-bottom: 0.75rem !important;
}

/* Hacer títulos más compactos */
.book-details-compact h2 {
    line-height: 1.3 !important;
}

/* Compactar información básica del libro */
.book-details-compact .text-muted {
    font-size: 0.9rem;
    margin-bottom: 0.5rem !important;
}

/* Mejoras de contraste */
.text-muted {
    color: #6c757d !important;
}

.badge.bg-success {
    color: #fff !important;
}

.badge.bg-warning {
    color: #212529 !important;
}

/* Efectos de hover mejorados */
.price-section:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.rating-section:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

/* Print styles */
@media print {
    .action-buttons, .btn {
        display: none !important;
    }
    
    .price-section, .rating-section, .book-details {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}