/* =========================================================
   DR PUBLICATIONS — BOOK DETAILS
   Reference-inspired premium medical-book product page
========================================================= */

:root {
    --details-navy: #102946;
    --details-gold: #b77a08;
    --details-gold-dark: #996500;
    --details-gold-soft: #f7eddc;
    --details-border: #eadfce;
    --details-text: #344054;
    --details-muted: #7a8495;
    --details-bg: #fbfaf7;
    --details-green: #159447;
}


/* =========================================================
   PAGE
========================================================= */

.book-details-page {
    background:
        linear-gradient(180deg, #ffffff 0%, var(--details-bg) 100%);
    padding: 28px 0 75px;
}

.details-container {
    width: min(92%, 1375px);
    margin: 0 auto;
}


/* =========================================================
   BREADCRUMB
========================================================= */

.details-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 20px;
    color: #697386;
    font-size: 14px;
}

.details-breadcrumb a {
    color: #697386;
    text-decoration: none;
}

.details-breadcrumb a:hover {
    color: var(--details-gold);
}

.details-breadcrumb i {
    color: #aeb5c0;
    font-size: 11px;
}

.details-breadcrumb a:first-child i {
    margin-right: 7px;
}


/* =========================================================
   MAIN CARD
========================================================= */

.book-details-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(430px, .9fr);
    gap: 50px;

    background: rgba(255,255,255,.96);
    border: 1px solid var(--details-border);
    border-radius: 22px;

    padding: 28px 28px 24px;

    box-shadow:
        0 8px 28px rgba(20, 38, 61, .035);
}


/* =========================================================
   GALLERY
========================================================= */

.book-gallery {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
}

.book-thumbnails {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.thumbnail-track {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
    max-height: 495px;
    overflow: hidden;
}

.book-thumb-item {
    flex: 0 0 86px;
    width: 86px;
    height: 86px;

    padding: 0;
    border: 1px solid #dddfe4;
    border-radius: 10px;

    overflow: hidden;
    background: #f6f7f8;

    cursor: pointer;
    transition: .2s ease;
}

.book-thumb-item:hover {
    border-color: var(--details-gold);
    transform: translateY(-1px);
}

.book-thumb-item.active {
    border: 2px solid var(--details-gold);
    box-shadow: 0 0 0 1px rgba(183,122,8,.08);
}

.book-thumb-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-nav {
    width: 38px;
    height: 38px;
    margin: 0 0 9px;

    border: 0;
    border-radius: 50%;

    background: #f6f6f5;
    color: #5c6573;

    cursor: pointer;
}

.gallery-nav-down {
    margin: 9px 0 0;
}

.gallery-nav:hover {
    background: var(--details-gold-soft);
    color: var(--details-gold);
}

.book-main-image {
    position: relative;
    min-width: 0;
    height: 590px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    border-radius: 16px;
    background: #f4f5f6;
}

.book-main-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.image-expand {
    position: absolute;
    top: 15px;
    right: 15px;

    width: 46px;
    height: 46px;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,.94);
    color: #526070;

    font-size: 17px;

    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,.08);
}

.image-expand:hover {
    color: var(--details-gold);
}


/* =========================================================
   INFORMATION
========================================================= */

.book-details-info {
    min-width: 0;
    padding: 0 0 5px;
}

.book-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 13px;
}

.book-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;

    padding: 0 14px;
    border-radius: 20px;

    background: #b77a08;
    color: #fff;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
}

.book-badge.soft {
    background: #fbf5ea;
    color: #96671d;
}

.book-details-info h1 {
    margin: 0 0 12px;

    color: var(--details-navy);

    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(32px, 3vw, 44px);
    line-height: 1.12;
    font-weight: 700;
}

.book-author {
    display: flex;
    align-items: center;
    gap: 7px;

    padding-bottom: 17px;
    border-bottom: 1px solid #ece8e1;

    color: #7c8490;
    font-size: 14px;
}

.book-author i {
    color: var(--details-gold);
    font-size: 16px;
}

.book-author strong {
    color: #27364a;
}


/* =========================================================
   PRICE
========================================================= */

.details-price-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;

    padding: 19px 0 17px;
}

.details-price {
    color: var(--details-gold);
    font-size: clamp(28px, 3vw, 34px);
    line-height: 1;
    font-weight: 800;
}

.details-mrp {
    color: #8d939b;
    font-size: 16px;
    text-decoration: line-through;
}

.details-discount {
    padding: 7px 10px;
    border-radius: 7px;
    background: #e8f7eb;
    color: #1e8741;
    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   STOCK / DELIVERY
========================================================= */

.purchase-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 17px;
}

.stock-status {
    margin: 0;
    color: #697386;
    font-size: 14px;
}

.stock-status i {
    margin-right: 7px;
}

.stock-status.available {
    color: var(--details-green);
}

.stock-status.low {
    color: #b97710;
}

.stock-status.out {
    color: #c0392b;
}

.stock-status strong {
    margin-right: 5px;
}

.delivery-info {
    display: flex;
    align-items: center;
    gap: 11px;
}

.delivery-info > i {
    color: #159447;
    font-size: 20px;
}

.delivery-info strong,
.delivery-info span {
    display: block;
}

.delivery-info strong {
    color: #168b43;
    font-size: 14px;
}

.delivery-info span {
    margin-top: 2px;
    color: #8a929e;
    font-size: 11px;
}


/* =========================================================
   EBOOK
========================================================= */

.ebook-benefit {
    display: flex;
    align-items: center;
    gap: 12px;

    margin: 0 0 16px;
    padding: 13px 14px;

    border: 1px solid #eadfce;
    border-radius: 10px;
    background: #fffaf1;
}

.ebook-benefit-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #f6e8ca;
    color: var(--details-gold);
}

.ebook-benefit strong,
.ebook-benefit span {
    display: block;
}

.ebook-benefit strong {
    margin-bottom: 3px;
    color: #26364b;
    font-size: 13px;
}

.ebook-benefit span {
    color: #7e8794;
    font-size: 11px;
    line-height: 1.45;
}


/* =========================================================
   CART + ACTIONS
========================================================= */

.details-cart-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.quantity-box {
    display: grid;
    grid-template-columns: 46px 1fr 46px;
    height: 58px;

    overflow: hidden;

    border: 1px solid #dfe2e7;
    border-radius: 11px;
    background: #fff;
}

.quantity-box button {
    border: 0;
    background: #f7f7f7;
    color: #445166;
    cursor: pointer;
}

.quantity-box button:hover {
    background: #f0eee9;
    color: var(--details-gold);
}

.quantity-box input {
    width: 100%;
    min-width: 0;

    border: 0;
    outline: 0;

    text-align: center;

    color: #28374c;
    font-size: 15px;
    background: #fff;
}

.details-add-cart {
    height: 58px;

    border: 0;
    border-radius: 11px;

    background: linear-gradient(180deg, #c78a12, #b47705);
    color: #fff;

    font-size: 15px;
    font-weight: 700;

    cursor: pointer;

    box-shadow: 0 7px 16px rgba(183,122,8,.14);
    transition: .2s ease;
}

.details-add-cart:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(183,122,8,.20);
}

.details-add-cart i {
    margin-right: 8px;
}

.secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.buy-now-btn,
.wishlist-btn {
    min-height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border-radius: 10px;

    text-decoration: none;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;
}

.buy-now-btn {
    border: 1px solid var(--details-gold);
    color: var(--details-gold);
    background: #fff;
}

.buy-now-btn:hover {
    background: var(--details-gold-soft);
}

.wishlist-btn {
    border: 1px solid #d9dde2;
    color: #596579;
    background: #fff;
}

.wishlist-btn:hover,
.wishlist-btn.active {
    border-color: #dfb8ad;
    color: #bf5f4d;
    background: #fffafa;
}


/* =========================================================
   META CARDS
========================================================= */

.book-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;
    min-height: 67px;

    padding: 12px 14px;

    border: 1px solid #eee8de;
    border-radius: 10px;

    background: #fcfbf9;
}

.meta-icon {
    flex: 0 0 38px;

    width: 38px;
    height: 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    color: var(--details-gold);
    font-size: 17px;
}

.meta-label,
.meta-value {
    display: block;
}

.meta-label {
    margin-bottom: 4px;
    color: #8b929e;
    font-size: 11px;
}

.meta-value {
    overflow: hidden;
    color: #29384d;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   LOWER CARD / TABS
========================================================= */

.details-lower-card {
    margin-top: 24px;

    overflow: hidden;

    background: #fff;

    border: 1px solid var(--details-border);
    border-radius: 20px;

    box-shadow:
        0 7px 24px rgba(20,38,61,.025);
}

.details-tabs {
    display: flex;
    align-items: stretch;
    overflow-x: auto;

    padding: 0 22px;

    border-bottom: 1px solid #eee9e1;
    scrollbar-width: thin;
}

.details-tab {
    flex: 0 0 auto;

    min-height: 66px;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 0 22px;

    border: 0;
    border-bottom: 2px solid transparent;

    background: transparent;

    color: #526078;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.details-tab i {
    font-size: 15px;
}

.details-tab:hover {
    color: var(--details-gold);
}

.details-tab.active {
    border-bottom-color: #d3a03c;
    background: #fbf1dc;
    color: var(--details-gold);
}

.details-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    padding: 0;
}

.details-tab-content {
    min-width: 0;
}

.tab-panel {
    display: none;
    padding: 28px 30px 32px;
}

.tab-panel.active {
    display: block;
}

.tab-panel h2 {
    margin: 0 0 15px;

    color: var(--details-navy);

    font-family: "Playfair Display", Georgia, serif;
    font-size: 31px;
}

.book-description,
.description-lead {
    color: #596579;
    font-size: 15px;
    line-height: 1.75;
}

.description-lead {
    margin: 0 0 12px;
}

.description-lead strong {
    font-weight: 600;
}


/* =========================================================
   DETAILS LIST
========================================================= */

.details-list,
.specification-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.details-list > div,
.specification-grid > div {
    display: flex;
    justify-content: space-between;
    gap: 20px;

    padding: 14px;

    border: 1px solid #eee8de;
    border-radius: 9px;

    background: #fcfbf9;
}

.details-list span,
.specification-grid span {
    color: #8a929f;
    font-size: 13px;
}

.details-list strong,
.specification-grid strong {
    color: #29384d;
    font-size: 13px;
    text-align: right;
}


/* =========================================================
   SHIPPING
========================================================= */

.shipping-points {
    display: grid;
    gap: 13px;
}

.shipping-points > div {
    display: flex;
    align-items: center;
    gap: 15px;

    padding: 16px;

    border: 1px solid #eee8de;
    border-radius: 10px;
}

.shipping-points > div > i {
    flex: 0 0 42px;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f7ead0;
    color: var(--details-gold);
}

.shipping-points strong,
.shipping-points span {
    display: block;
}

.shipping-points strong {
    margin-bottom: 3px;
    color: #29384d;
    font-size: 14px;
}

.shipping-points span {
    color: #7d8795;
    font-size: 12px;
}


/* =========================================================
   REVIEW
========================================================= */

.review-summary,
.empty-reviews {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 22px;

    border: 1px solid #eee8de;
    border-radius: 10px;

    background: #fcfbf9;
}

.review-summary i {
    color: var(--details-gold);
}

.empty-reviews {
    flex-direction: column;
    align-items: flex-start;
}

.empty-reviews i {
    color: #c2c6cc;
    font-size: 26px;
}

.empty-reviews strong {
    color: #29384d;
}

.empty-reviews span {
    color: #7d8795;
    font-size: 13px;
}


/* =========================================================
   TRUST SIDEBAR
========================================================= */

.details-trust-box {
    align-self: start;

    margin: 0 22px 24px 0;
    padding: 21px;

    border-radius: 14px;

    background: #fffbf4;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 0;
}

.trust-item + .trust-item {
    border-top: 1px solid #f1e9db;
}

.trust-icon {
    flex: 0 0 43px;

    width: 43px;
    height: 43px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f6ead2;
    color: var(--details-gold);
    font-size: 17px;
}

.trust-item strong,
.trust-item span {
    display: block;
}

.trust-item strong {
    margin-bottom: 3px;
    color: #29384d;
    font-size: 13px;
}

.trust-item span {
    color: #818b98;
    font-size: 11px;
    line-height: 1.4;
}


/* =========================================================
   RELATED BOOKS
========================================================= */

.related-books-section {
    margin-top: 48px;
}

.related-books-section h2 {
    margin: 0 0 22px;

    color: var(--details-navy);

    font-family: "Playfair Display", Georgia, serif;
    font-size: 29px;
}

.related-books-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.related-book-card {
    overflow: hidden;

    border: 1px solid var(--details-border);
    border-radius: 15px;

    background: #fff;

    transition: .22s ease;
}

.related-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(20,38,61,.07);
}

.related-book-image {
    height: 270px;
    background: #f5f5f5;
}

.related-book-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.related-book-info {
    padding: 16px;
}

.related-book-info h3 {
    margin: 0 0 6px;

    color: var(--details-navy);

    font-family: "Playfair Display", Georgia, serif;
    font-size: 17px;
    line-height: 1.35;
}

.related-author {
    margin-bottom: 12px;
    color: #87909c;
    font-size: 11px;
}

.related-price-row {
    display: flex;
    align-items: center;
    gap: 7px;
}

.related-price {
    color: var(--details-gold);
    font-size: 17px;
    font-weight: 700;
}

.related-mrp {
    color: #999;
    font-size: 11px;
    text-decoration: line-through;
}

.related-view {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 40px;
    margin-top: 12px;

    border: 1px solid var(--details-gold);
    border-radius: 20px;

    color: var(--details-gold);
    text-decoration: none;

    font-size: 12px;
    font-weight: 700;
}

.related-view:hover {
    background: var(--details-gold);
    color: #fff;
}


/* =========================================================
   IMAGE VIEWER
========================================================= */

.image-viewer {
    position: fixed;
    inset: 0;
    z-index: 99999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 30px;

    background: rgba(10,20,35,.88);
}

.image-viewer.show {
    display: flex;
}

.image-viewer img {
    max-width: min(92vw, 1000px);
    max-height: 90vh;

    object-fit: contain;

    border-radius: 8px;
    background: #fff;
}

.image-viewer-close {
    position: absolute;
    top: 22px;
    right: 25px;

    width: 45px;
    height: 45px;

    border: 0;
    border-radius: 50%;

    background: rgba(255,255,255,.12);
    color: #fff;

    font-size: 18px;

    cursor: pointer;
}

body.viewer-open {
    overflow: hidden;
}


/* =========================================================
   NOT FOUND
========================================================= */

.book-not-found {
    padding: 70px 0;
    background: var(--details-bg);
}

.not-found-box {
    width: min(92%, 600px);
    margin: 0 auto;
    padding: 55px 30px;

    background: #fff;
    border: 1px solid var(--details-border);
    border-radius: 20px;
    text-align: center;
}

.not-found-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    background: #f7ead1;
    color: var(--details-gold);
    font-size: 27px;
}

.not-found-box h1 {
    margin: 0 0 10px;
    color: var(--details-navy);
    font-family: "Playfair Display", Georgia, serif;
}

.not-found-box p {
    margin: 0 0 24px;
    color: #77808d;
}

.details-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 12px 22px;

    border-radius: 24px;
    background: var(--details-gold);
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   RESPONSIVE — 1200
========================================================= */

@media (max-width: 1200px) {

    .book-details-grid {
        grid-template-columns: minmax(0, 1fr) minmax(380px, .85fr);
        gap: 30px;
    }

    .book-main-image {
        height: 530px;
    }

    .details-content-layout {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

}


/* =========================================================
   RESPONSIVE — 992
========================================================= */

@media (max-width: 992px) {

    .book-details-grid {
        grid-template-columns: 1fr;
    }

    .book-main-image {
        height: min(650px, 75vw);
    }

    .details-content-layout {
        grid-template-columns: 1fr;
    }

    .details-trust-box {
        margin: 0 22px 22px;
    }

    .related-books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}


/* =========================================================
   RESPONSIVE — 700
========================================================= */

@media (max-width: 700px) {

    .book-details-page {
        padding: 20px 0 50px;
    }

    .details-container {
        width: 94%;
    }

    .book-details-grid {
        padding: 17px;
        border-radius: 15px;
        gap: 24px;
    }

    .book-gallery {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .book-thumbnails {
        order: 2;
        display: block;
    }

    .thumbnail-track {
        flex-direction: row;
        overflow-x: auto;
        max-height: none;
        padding-bottom: 5px;
        justify-content: flex-start;
    }

    .book-thumb-item {
        flex: 0 0 68px;
        width: 68px;
        height: 78px;
    }

    .gallery-nav {
        display: none;
    }

    .book-main-image {
        height: min(560px, 88vw);
        order: 1;
    }

    .book-details-info h1 {
        font-size: 32px;
    }

    .purchase-status-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .details-cart-row {
        grid-template-columns: 125px minmax(0, 1fr);
    }

    .secondary-actions {
        grid-template-columns: 1fr 1fr;
    }

    .book-meta {
        grid-template-columns: 1fr 1fr;
    }

    .details-tabs {
        padding: 0 8px;
    }

    .details-tab {
        min-height: 58px;
        padding: 0 14px;
        font-size: 12px;
    }

    .tab-panel {
        padding: 23px 20px 27px;
    }

    .tab-panel h2 {
        font-size: 27px;
    }

    .details-list,
    .specification-grid {
        grid-template-columns: 1fr;
    }

}


/* =========================================================
   RESPONSIVE — 480
========================================================= */

@media (max-width: 480px) {

    .details-breadcrumb {
        font-size: 12px;
        gap: 7px;
    }

    .book-details-grid {
        padding: 13px;
    }

    .book-main-image {
        height: 410px;
    }

    .book-details-info h1 {
        font-size: 29px;
    }

    .details-price {
        font-size: 28px;
    }

    .details-mrp {
        font-size: 14px;
    }

    .details-discount {
        font-size: 10px;
    }

    .details-cart-row {
        grid-template-columns: 1fr;
    }

    .quantity-box {
        width: 145px;
    }

    .details-add-cart {
        width: 100%;
    }

    .secondary-actions {
        grid-template-columns: 1fr;
    }

    .book-meta {
        grid-template-columns: 1fr;
    }

    .meta-item {
        min-height: 60px;
    }

    .related-books-grid {
        grid-template-columns: 1fr;
    }

    .related-book-image {
        height: 300px;
    }

    .details-trust-box {
        margin: 0 13px 18px;
    }

}
