/* ============================================
   DETALLE DEL LIBRO
   ============================================ */

.detalle-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Breadcrumb */
.breadcrumb {
    padding: 15px 0;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent-hover);
}

.breadcrumb .separator {
    margin: 0 8px;
    color: var(--border-color);
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

/* Sección Principal */
.detalle-main {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 40px;
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.detalle-imagen {
    position: relative;
}

.detalle-imagen img {
    width: 100%;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

.badge-descuento {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--danger-color);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
}

.detalle-categoria a {
    display: inline-block;
    background: var(--bg-tertiary);
    color: var(--secondary-color);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    text-decoration: none;
    margin-bottom: 15px;
    font-weight: 600;
}

.detalle-categoria a:hover {
    background: var(--accent-color);
    color: var(--primary-dark);
}

.detalle-titulo {
    font-family: var(--font-display);
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.2;
}

.detalle-subtitulo {
    font-size: 18px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 15px;
}

.detalle-autores {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.autor-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

.autor-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.detalle-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detalle-rating .stars {
    display: flex;
    gap: 3px;
}

.rating-text {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.rating-count {
    color: var(--text-muted);
    font-size: 14px;
}

.detalle-precio {
    margin-bottom: 25px;
}

.precio-actual {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-color);
}

.precio-original {
    font-size: 20px;
    color: var(--text-muted);
    text-decoration: line-through;
    margin-left: 15px;
}

.precio-ahorro {
    display: inline-block;
    background: rgba(46, 92, 62, 0.1);
    color: var(--success-color);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 15px;
}

.detalle-formato {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.formato-item {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.formato-item i {
    color: var(--accent-color);
    font-size: 18px;
}

.detalle-stock {
    margin-bottom: 25px;
    font-size: 15px;
    font-weight: 600;
}

.stock-ok {
    color: var(--success-color);
}

.stock-low {
    color: var(--warning-color);
}

.stock-out {
    color: var(--danger-color);
}

.detalle-acciones {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn-comprar {
    flex: 2;
    padding: 15px 25px;
    background: var(--accent-color);
    color: var(--primary-dark);
    border: 2px solid var(--accent-color);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-comprar:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-carrito {
    flex: 2;
    padding: 15px 25px;
    background: var(--primary-color);
    color: var(--text-light);
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-carrito:hover {
    background: transparent;
    color: var(--primary-color);
}

.btn-favorito {
    width: 55px;
    height: 55px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--danger-color);
}

.btn-favorito:hover {
    background: #fff5f5;
    border-color: var(--danger-color);
}

.detalle-etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.etiqueta-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 12px;
    border: 1px solid var(--border-color);
}

/* Tabs */
.detalle-descripcion {
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 30px;
    margin-bottom: 30px;
}

.descripcion-tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content h2 {
    font-family: var(--font-display);
    color: var(--primary-color);
    font-size: 22px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.tab-content p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.detalles-table {
    width: 100%;
    border-collapse: collapse;
}

.detalles-table th,
.detalles-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.detalles-table th {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    font-weight: 600;
    width: 200px;
}

.autor-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
}

.autor-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    font-family: var(--font-display);
    flex-shrink: 0;
}

.autor-info h3 {
    font-family: var(--font-display);
    color: var(--primary-color);
    margin-bottom: 5px;
}

.autor-nacionalidad {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.autor-bio {
    font-size: 14px;
    line-height: 1.6;
}

.resena-card {
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid var(--accent-color);
}

.resena-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.resena-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.resena-info {
    flex: 1;
}

.resena-stars {
    margin-top: 3px;
}

.resena-fecha {
    font-size: 12px;
    color: var(--text-muted);
}

.resena-card h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-family: var(--font-primary);
}

.sin-resenas {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

.similares-section {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.similares-section h2 {
    font-family: var(--font-display);
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--accent-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .detalle-main {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .detalle-imagen {
        max-width: 350px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .detalle-titulo {
        font-size: 26px;
    }
    
    .precio-actual {
        font-size: 32px;
    }
    
    .detalle-formato {
        grid-template-columns: 1fr;
    }
    
    .detalle-acciones {
        flex-direction: column;
    }
    
    .btn-comprar, .btn-carrito {
        width: 100%;
    }
    
    .autor-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
/* Detalle de libro V2 */
.book-detail-v2 { padding: 30px 0 15px; }
.detail-breadcrumb { display: flex; align-items: center; gap: 8px; overflow: hidden; margin-bottom: 27px; color: #806e64; font-size: 11px; white-space: nowrap; }
.detail-breadcrumb i { color: #b5a399; font-size: 8px; }
.detail-breadcrumb span { overflow: hidden; text-overflow: ellipsis; }
.detail-breadcrumb a:hover { color: #8b6637; }
.detail-alert { display: flex; gap: 10px; margin-bottom: 18px; padding: 13px 15px; border-radius: 8px; }
.detail-alert.error { border-left: 4px solid #a64235; background: #fff1ef; color: #85362e; }
.detail-alert.success { border-left: 4px solid #39735d; background: #eef9f4; color: #2f604e; }
.detail-hero { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr) minmax(270px, 320px); gap: 48px; align-items: start; padding: 36px; border: 1px solid #e4d9cc; border-radius: 16px; background: #fff; box-shadow: 0 13px 38px rgba(58, 37, 29, .07); }
.detail-cover-panel { display: grid; gap: 16px; }
.detail-cover { aspect-ratio: 3 / 4.2; overflow: hidden; border-radius: 9px 14px 14px 9px; box-shadow: -7px 13px 25px rgba(39, 24, 19, .22); }
.detail-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.detail-file-note { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid #e6ddd2; border-radius: 9px; background: #faf7f2; }
.detail-file-note i { color: #8c683b; }
.detail-file-note span { display: grid; color: #8a7a72; font-size: 9px; }
.detail-file-note strong { color: #49342a; font-size: 11px; }
.detail-category { color: #946e3d; font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.detail-main-info h1 { margin: 10px 0 8px; color: #291a15; font: 750 clamp(34px, 4vw, 54px)/1.03 var(--font-display); letter-spacing: -.025em; }
.detail-subtitle { color: #726159; font: italic 17px var(--font-display); }
.detail-author { margin: 15px 0; color: #75645c; }
.detail-author strong { color: #4c352b; }
.detail-rating-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-bottom: 20px; border-bottom: 1px solid #ece4db; color: #86766e; font-size: 11px; }
.detail-rating-number { color: #39251e; font-size: 15px; font-weight: 850; }
.detail-stars { color: #b8863f; }
.detail-rating-row a { color: #7b5c36; font-weight: 750; }
.detail-description { margin: 22px 0; color: #604f47; font-size: 13px; line-height: 1.85; }
.detail-metadata { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border: 1px solid #e9e1d8; border-radius: 10px; overflow: hidden; }
.detail-metadata > div { min-width: 0; padding: 11px 13px; border-bottom: 1px solid #eee7df; }
.detail-metadata > div:nth-child(odd) { border-right: 1px solid #eee7df; }
.detail-metadata > div:nth-last-child(-n+2) { border-bottom: 0; }
.detail-metadata dt { color: #938078; font-size: 9px; text-transform: uppercase; }
.detail-metadata dt i { width: 15px; color: #a58150; }
.detail-metadata dd { overflow: hidden; margin-top: 3px; color: #47332a; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.detail-purchase-card { position: sticky; top: 145px; padding: 24px; border: 1px solid #dacbb6; border-radius: 13px; background: #faf6ee; box-shadow: 0 12px 28px rgba(56, 36, 28, .08); }
.purchase-label { color: #8a755f; font-size: 9px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.purchase-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.purchase-price strong { color: #2e1d17; font: 750 32px var(--font-display); }
.purchase-price del { color: #9c8b82; font-size: 11px; }
.purchase-price span { padding: 3px 7px; border-radius: 99px; background: #dcebdd; color: #396147; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.detail-purchase-card > p { margin: 9px 0; color: #64564e; font-size: 10px; }
.detail-purchase-card > p i { margin-right: 7px; color: #4f765e; }
.detail-primary-action { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 21px 0 9px; border: 0; border-radius: 8px; background: #3d2921; color: #fff; font-size: 12px; font-weight: 850; cursor: pointer; }
.detail-primary-action:hover { background: #684832; }
.detail-primary-action:disabled { opacity: .55; cursor: not-allowed; }
.detail-favorite { width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #d8cabc; border-radius: 8px; background: #fff; color: #614c40; font-size: 11px; font-weight: 750; cursor: pointer; }
.detail-favorite.active { border-color: #cf8d82; color: #a13f35; background: #fff6f4; }
.detail-purchase-card > small { display: block; margin-top: 15px; color: #8b7b73; font-size: 9px; text-align: center; }
.detail-reviews, .detail-related { margin-top: 70px; }
.detail-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; margin-bottom: 25px; }
.detail-section-heading > div:first-child span { color: #956f3d; font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.detail-section-heading h2 { margin: 5px 0 0; color: #2f201a; font: 750 32px var(--font-display); }
.review-summary { display: grid; text-align: right; }
.review-summary strong { color: #37241d; font: 750 27px var(--font-display); }
.review-summary span { color: #8f7d74; font-size: 9px; }
.review-form { margin-bottom: 25px; padding: 24px; border: 1px solid #e2d7ca; border-radius: 12px; background: #fff; }
.review-form h3 { margin-bottom: 17px; color: #36241d; font: 700 20px var(--font-display); }
.review-fields { display: grid; grid-template-columns: 180px 1fr; gap: 15px; }
.review-fields label { display: grid; gap: 6px; color: #5e4b42; font-size: 10px; font-weight: 800; }
.review-fields select, .review-fields textarea { padding: 10px 12px; border: 1px solid #d9cec1; border-radius: 7px; background: #fff; color: #34241e; }
.review-form button { margin-top: 13px; padding: 10px 17px; border: 0; border-radius: 7px; background: #3d2921; color: #fff; font-weight: 800; cursor: pointer; }
.reviews-list { display: grid; gap: 12px; }
.review-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 20px; border: 1px solid #e4dbd0; border-radius: 11px; background: #fff; }
.review-avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: #e9dbc6; color: #654c32; font-weight: 850; }
.review-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.review-head strong { color: #3e2a22; font-size: 12px; }
.review-head span { color: #b0813e; font-size: 9px; }
.review-head time { margin-left: auto; color: #988880; font-size: 9px; }
.review-card p { margin-top: 8px; color: #6c5b53; font-size: 11px; line-height: 1.7; }
.detail-empty { display: flex; align-items: center; gap: 14px; padding: 26px; border: 1px dashed #d9cdc0; border-radius: 10px; color: #7f6e65; }
.detail-empty i { font-size: 25px; color: #aa8a60; }
.detail-section-heading > a { color: #795b37; font-size: 11px; font-weight: 800; }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px; }
.related-card { overflow: hidden; border: 1px solid #e1d7ca; border-radius: 12px; background: #fff; transition: transform .2s, box-shadow .2s; }
.related-card:hover { transform: translateY(-4px); box-shadow: 0 14px 28px rgba(55, 35, 27, .11); }
.related-card img { width: 100%; aspect-ratio: 3 / 2.05; display: block; object-fit: cover; }
.related-card > div { padding: 15px; }
.related-card span { color: #9b7746; font-size: 8px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.related-card h3 { margin: 5px 0; color: #34231c; font: 700 17px/1.2 var(--font-display); }
.related-card p { overflow: hidden; color: #806f67; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.related-card strong { display: block; margin-top: 11px; color: #3c2921; }
@media (max-width: 1100px) { .detail-hero { grid-template-columns: 270px 1fr; } .detail-purchase-card { position: static; grid-column: 1 / -1; } }
@media (max-width: 760px) { .detail-hero { grid-template-columns: 1fr; padding: 22px; } .detail-cover-panel { max-width: 340px; margin: auto; } .detail-main-info h1 { font-size: 39px; } .detail-metadata { grid-template-columns: 1fr; } .detail-metadata > div { border-right: 0 !important; border-bottom: 1px solid #eee7df !important; } .detail-metadata > div:last-child { border-bottom: 0 !important; } .review-fields { grid-template-columns: 1fr; } .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .book-detail-v2 { padding-top: 18px; } .detail-hero { padding: 15px; } .detail-section-heading { align-items: flex-start; flex-direction: column; } .review-summary { text-align: left; } .related-grid { grid-template-columns: 1fr; } }
