/* =========================================================
   Asamedia Pustaka - Mobile App-like UI Theme (v4.1)
   ========================================================= */
:root {
    --app-primary: #1659a8;
    --app-secondary: #0d4282;
    --app-bg: #f1f5f9;
    --app-surface: #ffffff;
    --app-text: #0f172a;
    --app-muted: #64748b;
    --app-border: #e2e8f0;
}

body {
    background-color: var(--app-bg) !important;
    color: var(--app-text);
    padding-bottom: 84px !important;
}

/* Top App Bar (Mobile & Desktop App Shell) */
.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-secondary) 100%);
    padding: 10px 14px;
    box-shadow: 0 4px 16px rgba(13, 66, 130, 0.22);
    color: #ffffff;
}
.app-topbar-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.app-brand-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    color: #ffffff !important;
    flex-shrink: 0;
}
.app-brand-logo {
    height: 34px;
    width: auto;
    border-radius: 8px;
    background: #ffffff;
    padding: 2px 6px;
}
.app-search-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 4px 10px;
    height: 38px;
}
.app-search-box input {
    border: 0;
    outline: none;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
}
.app-search-box button {
    border: 0;
    background: transparent;
    color: var(--app-primary);
    font-size: 15px;
    padding: 0 4px;
    cursor: pointer;
}
.app-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.app-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-decoration: none !important;
}
.app-icon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 1.5px solid #ffffff;
}

/* App Capsule Container */
.app-main-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 12px 12px 24px;
}

/* Quick Hero & Banner Slider */
.app-hero-banner {
    background: linear-gradient(135deg, var(--app-primary) 0%, #0ea5e9 100%);
    border-radius: 18px;
    padding: 16px;
    color: #ffffff;
    margin-bottom: 14px;
    box-shadow: 0 6px 18px rgba(22, 89, 168, 0.18);
}
.app-quick-pills {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: #ffffff;
    border-radius: 16px;
    padding: 12px 8px;
    margin-bottom: 14px;
    border: 1px solid var(--app-border);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.app-pill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
    text-decoration: none !important;
    color: #1e293b !important;
    font-size: 11px;
    font-weight: 700;
}
.app-pill-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: rgba(22, 89, 168, 0.1);
    color: var(--app-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Section Card & Book Grid (Mirip Kartu Sembako / Layanan AsaMedia) */
.app-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 14px 2px 10px;
}
.app-section-title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}
.app-section-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--app-primary) !important;
}
.book-app-card {
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s ease;
}
.book-app-card:active {
    transform: scale(0.985);
}
.book-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #f8fafc;
    overflow: hidden;
}
.book-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-disc-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 8px;
}
.book-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}
.book-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.book-price-old {
    font-size: 10.5px;
    color: #94a3b8;
    text-decoration: line-through;
}
.book-price-now {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--app-primary);
}
.btn-book-cart {
    margin-top: 8px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: var(--app-primary);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 10px;
    cursor: pointer;
}

/* Floating Bottom Navigation Bar (Mirip AsaMedia App) */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    background: #ffffff;
    border-top: 1px solid var(--app-border);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 62px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app-bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: #64748b !important;
    font-size: 10.5px;
    font-weight: 700;
    gap: 2px;
    position: relative;
}
.app-bnav-item.active,
.app-bnav-item:hover {
    color: var(--app-primary) !important;
}
.app-bnav-item i {
    font-size: 18px;
}
/* Penyesuaian Footer, Tombol Live Chat & Halaman Dalam */
.chat-sticky {
    bottom: 76px !important;
    right: 14px !important;
    border-radius: 99px !important;
    padding: 10px 16px !important;
    box-shadow: 0 6px 18px rgba(13, 66, 130, 0.25) !important;
    z-index: 1035 !important;
}
footer.bg-foot {
    padding-bottom: 95px !important;
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
}
.bread-crumb {
    max-width: 980px;
    margin: 10px auto 6px !important;
    padding: 8px 14px !important;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--app-border);
    font-size: 12px;
}
.sec-product-detail .section,
.bayarpesanan .section {
    border-radius: 18px !important;
    border: 1px solid var(--app-border) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}
/* =========================================================
   Lanjutan: Katalog Bookstore, Detail Buku, Keranjang & Akun
   ========================================================= */
.sec-product-detail .container,
.bayarpesanan,
.bg0 > .container {
    max-width: 980px !important;
}

/* Galeri Sampul Buku pada Halaman Detail Produk */
.prod-preview {
    background: #ffffff;
    border-radius: 18px;
    padding: 14px;
    border: 1px solid var(--app-border);
    text-align: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
.prod-preview img {
    max-height: 360px;
    width: auto;
    max-width: 100%;
    border-radius: 12px;
    object-fit: contain;
}
.prod-thumb {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.prod-thumb-item {
    width: 58px;
    height: 74px;
    border-radius: 10px;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--app-border);
    flex-shrink: 0;
    cursor: pointer;
}
.prod-thumb-item:hover {
    border-color: var(--app-primary);
}

/* Kartu Item Keranjang Belanja & Checkout */
.keranjang.row,
.produk-item.row {
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: 16px;
    padding: 12px;
    margin: 0 0 10px 0 !important;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
    align-items: center;
}
.keranjang.bg-foot {
    background: rgba(22, 89, 168, 0.08) !important;
    color: var(--app-primary) !important;
    border-radius: 12px;
    padding: 8px 14px;
    margin-bottom: 8px;
    font-size: 12.5px;
}

/* Kartu Metode Pembayaran (Checkout & Invoice) */
.metodebayar,
.metode-item,
.tripay_payment {
    background: #ffffff !important;
    border: 1.5px solid var(--app-border) !important;
    border-radius: 14px !important;
    padding: 12px !important;
    cursor: pointer;
    transition: all 0.15s ease;
}
.metodebayar.active,
.metode-item.active,
.tripay_payment.active {
    border-color: var(--app-primary) !important;
    background: rgba(22, 89, 168, 0.06) !important;
}

/* Tombol & Input bergaya Aplikasi Modern */
.btn {
    border-radius: 12px !important;
    font-weight: 700 !important;
}
.form-control {
    border-radius: 12px !important;
    border: 1.5px solid #cbd5e1;
}
.form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 3px rgba(22, 89, 168, 0.12);
}

/* Modal Pop-up Bergaya Aplikasi */
.modal-content {
    border-radius: 20px !important;
    border: 0 !important;
    overflow: hidden;
}

/* Responsif Layar HP */
@media (max-width: 767px) {
    .app-brand-logo {
        height: 30px;
    }
    .app-search-box {
        height: 36px;
        padding: 3px 8px;
    }
    .app-search-box input {
        font-size: 12px;
    }
    .hidesmall {
        display: none !important;
    }
}
/* =========================================================
   Penstabil Layout & Reset Bentrok CSS Lama
   ========================================================= */
img {
    max-width: 100%;
    height: auto;
}
.app-topbar * {
    box-sizing: border-box;
}
.book-cover-wrap {
    position: relative !important;
    width: 100% !important;
    height: 210px !important;
    background: #f8fafc !important;
    overflow: hidden !important;
    display: block !important;
}
.book-cover-wrap img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}
footer.bg-foot {
    background: #0f172a !important;
    color: #cbd5e1 !important;
    padding: 36px 16px 95px !important;
    margin-top: 24px !important;
}
footer.bg-foot h4 {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    margin-bottom: 12px !important;
}
footer.bg-foot a,
footer.bg-foot td,
footer.bg-foot p {
    color: #cbd5e1 !important;
    font-size: 12.5px !important;
}
footer.bg-foot ul {
    list-style: none !important;
    padding-left: 0 !important;
}
.hidesmall {
    display: none !important;
}
@media (min-width: 768px) {
    .book-cover-wrap {
        height: 245px !important;
    }
}
