/* ============================================================
   Shop — Product Detail Page (shop/show)
   Depends on: main.css (for --primary-color, --secondary-color,
   --card-radius, --transition, --text-dark, --bg-*, --border-color etc.)
   ============================================================ */

/* ── Page-level vars ─────────────────────────────────────── */
.book-detail-page {
    /* Variant branding color — updated by JS on variant change.
       Defaults to --primary-color (#0c9dbf). */
    --vc:        var(--primary-color);
    --vc-light:  rgba(12, 157, 191, 0.1);
    --vc-soft:   rgba(12, 157, 191, 0.06);
    --vc-shadow: rgba(12, 157, 191, 0.2);

    --shop-card-radius: 20px;

    background: var(--bg-light);
    padding: 2rem 0 5rem;
    min-height: 100vh;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb-nav {
    background: var(--bg-card);
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-soft);
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    display: inline-flex;
    align-items: center;
}
.breadcrumb-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.breadcrumb-nav a:hover { color: var(--primary-color); }
.breadcrumb-nav .sep {
    color: var(--text-muted);
    margin: 0 0.5rem;
    font-size: 0.8rem;
}
.breadcrumb-nav .current {
    color: var(--primary-color);
    font-weight: 600;
}

/* ── Main Cards ──────────────────────────────────────────── */
.book-detail-card {
    background: var(--bg-card);
    border-radius: var(--shop-card-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* ── Image Section ───────────────────────────────────────── */
.book-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 140%;
    border-radius: 16px;
    background: var(--vc-light);
    overflow: hidden;
}
@media (min-width: 992px) {
    .book-img-wrap {
        padding-top: 0;
        flex: 1;
        min-height: 280px;
    }
}
.book-img-wrap img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: top center;
    padding: 0;
    transition: var(--transition);
}
.book-img-wrap:hover img { transform: scale(1.05); }

/* ── Badges ──────────────────────────────────────────────── */
.badge-float {
    position: absolute;
    top: 1rem; left: 1rem;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.badge-modern {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.badge-modern.bundle { color: var(--primary-color); }
.badge-modern.single { color: var(--secondary-color); }

/* ── Typography ──────────────────────────────────────────── */
.book-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.25;
    margin-bottom: 0.6rem;
}

/* ── Variant Selector ────────────────────────────────────── */
.variant-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    display: block;
}
.variant-option {
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 0.55rem 1rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
}
.variant-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}
input[name="variant"]:checked + .variant-option {
    border-color: var(--vc);
    background: var(--vc-soft);
    box-shadow: 0 4px 15px var(--vc-shadow);
}
.variant-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--vc);
}

/* ── Quantity Controls ───────────────────────────────────── */
.qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-light);
    padding: 0.25rem;
    border-radius: 12px;
}
.qty-btn {
    width: 30px; height: 30px;
    border: none;
    background: var(--bg-card);
    border-radius: 8px;
    font-weight: 700;
    color: var(--text-dark);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.qty-btn:hover { background: var(--vc); color: white; }
.qty-input {
    width: 36px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.qty-input:focus { outline: none; }
.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input[type=number] { -moz-appearance: textfield; }

/* ── Total Block ─────────────────────────────────────────── */
.total-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-light);
    border-radius: 12px;
    padding: 0.65rem 1.1rem;
    margin: 0.75rem 0;
}
.total-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}
.total-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--vc);
    line-height: 1;
}

/* ── Action Buttons ──────────────────────────────────────── */
.action-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1rem;
}
.btn-detail-action {
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    width: 100%;
}
.btn-outline-primary-soft {
    background: var(--bg-card);
    color: var(--vc);
    border: 2px solid var(--vc-soft);
}
.btn-outline-primary-soft:hover {
    background: var(--vc);
    color: white;
    border-color: var(--vc);
    box-shadow: 0 5px 15px var(--vc-shadow);
}
.btn-primary-soft {
    background: var(--vc);
    color: white;
    box-shadow: 0 4px 12px var(--vc-shadow);
}
.btn-primary-soft:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--vc-shadow);
    color: white;
    filter: brightness(1.08);
}

/* ── Info Section Cards ──────────────────────────────────── */
.section-card {
    background: var(--bg-card);
    border-radius: var(--shop-card-radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
    box-shadow: var(--shadow-soft);
}
.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.9rem;
    color: var(--text-dark);
    position: relative;
    padding-left: 1rem;
}
.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--vc);
    border-radius: 2px;
}

/* ── Included Items ──────────────────────────────────────── */
.included-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}
.icon-box {
    width: 48px; height: 48px;
    background: var(--bg-card);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-soft);
}
.icon-box.physical {
    background: rgba(12, 157, 191, 0.1);
    color: var(--primary-color);
}
.icon-box.digital {
    background: rgba(63, 63, 175, 0.1);
    color: var(--secondary-color);
}

/* ── Sample Modal Close Button ───────────────────────────── */
.sample-modal-close-btn {
    background: var(--vc);
    color: white;
    border: none;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.sample-modal-close-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .book-title { font-size: 1.75rem; }
    .action-grid { grid-template-columns: 1fr; }
    .book-detail-card { padding: 1.5rem; }
}

/* ── Dark Mode ───────────────────────────────────────────── */
[data-theme='dark'] .book-detail-page   { background: var(--bg-body); }
[data-theme='dark'] .breadcrumb-nav     { background: var(--bg-card); border-color: var(--border-color); }
[data-theme='dark'] .book-detail-card,
[data-theme='dark'] .section-card       { background: var(--bg-card); border-color: var(--border-color); }
[data-theme='dark'] .book-img-wrap      { background: var(--vc-soft); }
[data-theme='dark'] .badge-modern       { background: var(--bg-card); border: 1px solid var(--border-color); }
[data-theme='dark'] .book-title         { color: var(--text-dark); }
[data-theme='dark'] .book-desc,
[data-theme='dark'] .text-muted         { color: var(--text-muted) !important; }
[data-theme='dark'] .variant-option     { background: var(--bg-body); border-color: var(--border-color); }
[data-theme='dark'] .variant-option:hover { border-color: var(--primary-color); }
[data-theme='dark'] input[name="variant"]:checked + .variant-option { background: var(--bg-card); border-color: var(--vc); }
[data-theme='dark'] .icon-box           { background: var(--bg-card); }
[data-theme='dark'] .bg-light           { background-color: var(--bg-body) !important; }
[data-theme='dark'] .text-dark          { color: var(--text-dark) !important; }
[data-theme='dark'] .qty-controls       { background: var(--bg-body); }
[data-theme='dark'] .qty-btn            { background: var(--bg-card); color: var(--text-main); }
[data-theme='dark'] .qty-input          { color: var(--text-main); }
[data-theme='dark'] .total-block        { background: var(--bg-body); border: 1px solid var(--border-color); }
[data-theme='dark'] .btn-outline-primary-soft { background: var(--bg-body); }
