/* ============================================================================
   Animated Multi-eBook & Category Storefront CSS — Pandu Digital Store
   ============================================================================ */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --accent: #f97316;
    --emerald: #10b981;
    --dark: #0f172a;
    --slate: #334155;
    --muted: #64748b;
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    color: var(--dark);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; transition: all 0.25s ease; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 18px; }
.narrow-container { max-width: 760px; }

/* Keyframe Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes floatBook {
    0%, 100% { transform: translateY(0px) rotate(-1deg); }
    50%      { transform: translateY(-10px) rotate(1deg); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.45); }
    50%      { box-shadow: 0 0 0 12px rgba(79, 70, 229, 0); }
}

@keyframes gradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.animate-fade-up { animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both; }

/* Promo Bar & Sticky Navbar */
.top-promo-bar {
    background: linear-gradient(270deg, #1e1b4b, #4f46e5, #db2777, #ea580c);
    background-size: 300% 300%;
    animation: gradientFlow 10s ease infinite;
    color: #fff;
    text-align: center;
    padding: 9px 14px;
    font-size: 0.88rem;
    font-weight: 600;
}

.site-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 12px;
    flex-wrap: wrap;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 1.22rem;
    color: var(--dark);
}

.brand-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.main-nav a:not(.btn) {
    color: var(--slate);
    font-weight: 600;
    font-size: 0.94rem;
    padding: 6px 10px;
    border-radius: 8px;
}

.main-nav a:not(.btn):hover {
    background: #eef2ff;
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.96rem;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

.btn:active { transform: scale(0.97); }
.btn-sm { padding: 8px 15px; font-size: 0.86rem; border-radius: 10px; }
.btn-lg { padding: 15px 28px; font-size: 1.06rem; }
.btn-block { display: flex; width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    box-shadow: 0 10px 22px -6px rgba(79, 70, 229, 0.55);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -6px rgba(79, 70, 229, 0.7);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: var(--dark);
    border-color: var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f5f3ff;
}

/* Hero Banner */
.store-hero {
    padding: 52px 0 44px;
    background: radial-gradient(circle at 85% 20%, #e0e7ff 0%, #fdf2f8 45%, #f8fafc 100%);
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
    animation: fadeUp 0.6s ease both;
}

.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.82rem;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
    border: 1px solid #c7d2fe;
}

.hero-inner h1 {
    font-size: 2.65rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #0f172a 20%, #4f46e5 65%, #db2777 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-inner p {
    font-size: 1.1rem;
    color: var(--slate);
    margin-bottom: 26px;
}

/* Interactive Search & Category Filter Bar */
.search-filter-wrap {
    margin-top: 10px;
}

.search-box-bar {
    max-width: 540px;
    margin: 0 auto 22px;
    position: relative;
}

.search-box-bar input {
    width: 100%;
    padding: 15px 20px 15px 46px;
    border-radius: 999px;
    border: 2px solid #cbd5e1;
    font-size: 1rem;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    transition: all 0.25s ease;
}

.search-box-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.search-icon-pos {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
}

.category-pills-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--slate);
    font-weight: 700;
    font-size: 0.92rem;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.cat-pill:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

.cat-pill.active {
    background: linear-gradient(135deg, var(--primary), #7c3aed);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 8px 18px -4px rgba(79, 70, 229, 0.55);
}

.cat-count {
    background: rgba(15, 23, 42, 0.08);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.76rem;
}

.cat-pill.active .cat-count {
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
}

/* Multi-eBook Store Grid & Animated Cards */
.catalog-section {
    padding: 48px 0 72px;
}

.ebooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 28px;
}

.ebook-card {
    background: var(--card);
    border-radius: 20px;
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    animation: fadeUp 0.5s ease both;
    position: relative;
}

.ebook-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 44px -12px rgba(79, 70, 229, 0.22);
    border-color: #c7d2fe;
}

.ebook-card-visual {
    position: relative;
    background: linear-gradient(145deg, #0f172a, #1e1b4b);
    padding: 24px 20px 18px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
}

.ebook-card-cover {
    width: 155px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ebook-card:hover .ebook-card-cover {
    transform: scale(1.06) rotate(-1.5deg);
}

.card-badge-top {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--dark);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.card-discount-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #22c55e;
    color: #fff;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 999px;
}

.ebook-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ebook-cat-tag {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.ebook-card-title {
    font-size: 1.18rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 8px;
    color: var(--dark);
}

.ebook-card-desc {
    font-size: 0.9rem;
    color: var(--slate);
    margin-bottom: 14px;
    flex: 1;
}

.ebook-meta-mini {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 600;
    padding: 10px 0;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
    margin-bottom: 14px;
}

.ebook-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.card-price-block .offer-p {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--dark);
}

.card-price-block .reg-p {
    font-size: 0.9rem;
    color: var(--muted);
    text-decoration: line-through;
    margin-left: 6px;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* Interactive Quick-View Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 18px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-sheet {
    background: #fff;
    width: 100%;
    max-width: 680px;
    border-radius: 22px;
    padding: 28px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: fadeUp 0.3s ease both;
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 1.1rem;
    cursor: pointer;
}

.modal-book-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 24px;
    align-items: start;
}

.modal-highlights {
    list-style: none;
    margin: 14px 0;
}

.modal-highlights li {
    padding: 5px 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--slate);
}

/* Checkout & Forms */
.page-wrapper { padding: 44px 0 72px; }
.checkout-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 30px; align-items: start; }
.checkout-summary-card, .checkout-form-card, .card-box, .status-card, .payment-processing-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}
.summary-book-header { display: flex; gap: 16px; align-items: center; margin-bottom: 20px; }
.summary-cover { width: 88px; border-radius: 10px; }
.coupon-form { display: flex; gap: 10px; margin-bottom: 10px; }
.price-breakdown { background: var(--bg); padding: 18px; border-radius: 12px; margin: 18px 0; }
.breakdown-row { display: flex; justify-content: space-between; padding: 6px 0; }
.discount-row { color: var(--emerald); font-weight: 700; }
.total-row { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-size: 1.22rem; font-weight: 900; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.form-control { width: 100%; padding: 12px 14px; border: 1.5px solid #cbd5e1; border-radius: 10px; font-size: 1rem; }
.form-control:focus { outline: none; border-color: var(--primary); }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 600; }
.alert-danger { background: #fee2e2; color: #b91c1c; }
.alert-warning { background: #fef3c7; color: #b45309; }
.alert-success-sm { color: #16a34a; font-size: 0.88rem; font-weight: 600; }
.alert-error-sm { color: #dc2626; font-size: 0.88rem; font-weight: 600; }
.status-card, .payment-processing-card { max-width: 660px; margin: 0 auto; text-align: center; }
.status-badge-lg { display: inline-block; padding: 8px 16px; border-radius: 999px; font-weight: 800; margin-bottom: 14px; background: #dcfce7; color: #15803d; }
.order-receipt-box { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin: 20px 0; text-align: left; }
.receipt-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.receipt-row:last-child { border-bottom: none; }

/* Footer & Floating WhatsApp */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 48px 0 26px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 28px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #94a3b8; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; padding-top: 20px; font-size: 0.84rem; color: #64748b; text-align: center; }
.whatsapp-float {
    position: fixed; bottom: 20px; right: 20px; background: #25d366; color: #fff;
    padding: 12px 18px; border-radius: 999px; font-weight: 700; display: inline-flex;
    align-items: center; gap: 8px; box-shadow: 0 10px 25px rgba(37, 211, 102, 0.45); z-index: 900;
}

@media (max-width: 780px) {
    .hero-inner h1 { font-size: 2rem; }
    .checkout-grid, .footer-grid, .modal-book-grid { grid-template-columns: 1fr; }
}


/* Share Buttons & Toast Notification */
.btn-share {
    background: #f1f5f9;
    color: var(--slate);
    border: 1.5px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.2s ease;
}
.btn-share:hover {
    background: #e0e7ff;
    color: var(--primary);
    border-color: #c7d2fe;
}
.share-strip-modal {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.share-toast {
    position: fixed;
    bottom: 82px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #fff;
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 2500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.popup-custom-box {
    background: #eef2ff;
    border-left: 4px solid var(--primary);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #1e1b4b;
    font-weight: 600;
    margin: 10px 0;
}

/* Enhanced Mobile-First Responsiveness */
@media (max-width: 640px) {
    .container { padding: 0 14px; }
    .top-promo-bar { font-size: 0.78rem; padding: 7px 10px; }
    .nav-container { min-height: 56px; gap: 6px; }
    .brand-logo { font-size: 1.05rem; }
    .brand-badge { width: 32px; height: 32px; font-size: 1rem; }
    .main-nav { gap: 4px; width: 100%; justify-content: space-around; padding-top: 6px; padding-bottom: 6px; border-top: 1px solid #f1f5f9; }
    .main-nav a:not(.btn) { font-size: 0.83rem; padding: 5px 8px; }
    .store-hero { padding: 26px 0 22px; }
    .hero-inner h1 { font-size: 1.72rem; }
    .hero-inner p { font-size: 0.94rem; margin-bottom: 16px; }
    .search-box-bar { margin-bottom: 14px; }
    .search-box-bar input { padding: 12px 16px 12px 40px; font-size: 0.92rem; }
    .category-pills-bar {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .category-pills-bar::-webkit-scrollbar { display: none; }
    .cat-pill { white-space: nowrap; flex-shrink: 0; padding: 8px 14px; font-size: 0.84rem; }
    .catalog-section { padding: 24px 0 60px; }
    .ebooks-grid { grid-template-columns: 1fr; gap: 18px; }
    .ebook-card-footer { flex-direction: column; align-items: stretch; gap: 10px; }
    .card-price-block { display: flex; align-items: baseline; justify-content: space-between; }
    .card-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
    .modal-sheet { padding: 20px 16px; border-radius: 18px; max-height: 92vh; }
    .modal-book-grid { grid-template-columns: 1fr; gap: 14px; }
    .whatsapp-float { bottom: 14px; right: 14px; padding: 10px 15px; font-size: 0.84rem; }
}
