:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --text: #1a2b48;
    --muted: #64748b;
    --primary: #e8635a;
    --primary-dark: #d04f46;
    --navy: #1a2b48;
    --navy-dark: #0f1a2e;
    --border: rgba(26, 43, 72, 0.1);
    --shadow: 0 18px 50px rgba(26, 43, 72, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

section[id] {
    scroll-margin-top: 96px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 2rem));
    margin-inline: auto;
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.btn-primary,
.btn-outline,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    padding: 0.85rem 1.5rem;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(232, 99, 90, 0.35);
}

.btn-outline {
    background: transparent;
    color: var(--navy);
    border: 1.5px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-secondary {
    background: #fff;
    color: var(--navy);
    border: 1px solid var(--border);
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 84px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--navy);
    flex-shrink: 0;
    min-width: 0;
}

.site-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.site-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.site-brand-name {
    font-weight: 800;
    font-size: 1.02rem;
    line-height: 1.2;
    white-space: nowrap;
}

.site-brand-tagline {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--muted);
    line-height: 1.3;
    white-space: nowrap;
}

.site-brand-text {
    font-weight: 800;
    font-size: 1.05rem;
}

.site-brand-light {
    color: #fff;
}

.site-brand-light .site-brand-icon {
    background: rgba(255, 255, 255, 0.15);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--navy);
    font-size: 1.4rem;
}

.site-header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.site-search-wrap {
    position: relative;
}

.nav-search {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: #eef2f7;
    color: var(--navy);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-search:hover,
.nav-search[aria-expanded="true"] {
    background: #e4eaf2;
    color: var(--primary);
}

.site-search-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(320px, calc(100vw - 2rem));
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 0.5rem;
    z-index: 30;
}

.site-search-panel[hidden] {
    display: none !important;
}

.site-search-panel input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--navy);
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
}

.site-search-submit {
    border: none;
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
}

.site-search-submit:hover {
    background: #243a5f;
}

.site-header-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

.nav-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0.25rem 0.35rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--navy);
    font-size: 0.92rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.nav-login i {
    font-size: 1.35rem;
}

.nav-login:hover {
    color: var(--primary);
}

.site-nav > a.nav-login-mobile,
.site-nav .site-search-mobile {
    display: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    margin-inline: auto;
    padding-inline: 0.5rem;
}

.site-nav > a,
.nav-dropdown > button {
    color: var(--navy);
    font-weight: 600;
    font-size: 0.94rem;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0;
    position: relative;
    white-space: nowrap;
}

.nav-dropdown > button i {
    font-size: 0.72rem;
    opacity: 0.85;
}

.site-nav > a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--primary);
    border-radius: 999px;
}

.nav-dropdown.nav-active > button,
.nav-dropdown > button.active {
    color: var(--primary);
}

.nav-dropdown.nav-active > button::after,
.nav-dropdown > button.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--primary);
    border-radius: 999px;
}

.nav-dropdown > button {
    position: relative;
}

.site-nav > a:hover,
.nav-dropdown > button:hover {
    color: var(--primary);
}

.nav-dropdown {
    position: relative;
}

/* Jembatan hover agar submenu tidak hilang saat kursor pindah ke bawah */
.nav-dropdown::after {
    content: '';
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: 12px;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
    border: 1px solid var(--border);
    z-index: 20;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.65rem 1rem;
    color: var(--navy);
    font-size: 0.9rem;
}

.nav-dropdown-menu a:hover {
    background: #fef2f1;
    color: var(--primary);
}

.nav-cta {
    flex-shrink: 0;
    padding: 0.72rem 1.15rem;
    font-size: 0.88rem;
    white-space: nowrap;
}

.site-nav > a.nav-cta-mobile {
    display: none;
}

/* Footer */
.site-footer {
    background: var(--navy-dark);
    color: rgba(255, 255, 255, 0.82);
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 2rem;
    padding: 3.5rem 0 2.5rem;
}

.site-footer-brand p {
    margin: 1rem 0 1.25rem;
    line-height: 1.75;
    max-width: 280px;
    color: rgba(255, 255, 255, 0.7);
}

.site-social {
    display: flex;
    gap: 0.65rem;
}

.site-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: grid;
    place-items: center;
    color: #fff;
    transition: background 0.2s ease;
}

.site-social a:hover {
    background: var(--primary);
}

.site-footer h4 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.site-footer a,
.site-footer p {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.68);
    margin-bottom: 0.65rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

.site-footer a:hover {
    color: #fff;
}

.site-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 0;
}

.site-footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.55);
}

.site-footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-footer-links a:hover {
    color: #fff;
}

/* Shared book card styles for inner pages */
.book-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: grid;
}

.book-card img {
    width: 100%;
    aspect-ratio: 3 / 4.2;
    object-fit: cover;
}

.book-info {
    padding: 1rem;
    display: grid;
    gap: 0.35rem;
}

.book-price {
    font-weight: 700;
    color: var(--primary-dark);
}

.page-hero {
    padding: 2.5rem 0 1.5rem;
}

@media (max-width: 1100px) {
    .site-nav {
        gap: 1.15rem;
    }

    .site-brand-tagline {
        display: none;
    }

    .nav-login span {
        display: none;
    }
}

@media (max-width: 1024px) {
    .site-nav {
        gap: 0.85rem;
    }

    .site-nav > a,
    .nav-dropdown > button {
        font-size: 0.85rem;
    }

    .site-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .site-header-inner {
        min-height: 72px;
    }

    .site-header-actions {
        margin-left: auto;
        gap: 0.55rem;
    }

    .site-header-divider,
    .site-search-wrap {
        display: none;
    }

    .nav-login {
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--border);
        background: #fff;
    }

    .nav-login span {
        display: none;
    }

    .nav-toggle {
        display: grid;
        place-items: center;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .site-nav.open {
        display: flex;
    }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 0.5rem;
        display: none;
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .nav-cta {
        display: none;
    }

    .site-nav > a.nav-cta-mobile {
        display: inline-flex;
        margin-top: 0.5rem;
        background: var(--primary);
        color: #fff;
        padding: 0.85rem 1.5rem;
        border-radius: 999px;
        font-weight: 700;
        position: static;
    }

    .site-nav > a.nav-cta-mobile::after {
        display: none;
    }

    .site-nav > a.nav-cta-mobile:hover {
        color: #fff;
        background: var(--primary-dark);
    }

    .site-nav > a.nav-login-mobile {
        display: inline-flex;
        margin-top: 0.35rem;
        color: var(--navy);
        font-weight: 600;
        gap: 0.45rem;
        position: static;
    }

    .site-nav > a.nav-login-mobile::after {
        display: none;
    }

    .site-nav > a.nav-login-mobile:hover {
        color: var(--primary);
    }

    .site-nav .site-search-mobile {
        display: flex;
        align-items: center;
        gap: 0.55rem;
        margin-top: 0.75rem;
        padding: 0.65rem 0.85rem;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: #f8fafc;
    }

    .site-nav .site-search-mobile i {
        color: var(--muted);
    }

    .site-nav .site-search-mobile input {
        flex: 1;
        border: none;
        background: transparent;
        outline: none;
        color: var(--navy);
        font-size: 0.9rem;
    }
}

@media (max-width: 640px) {
    .site-footer-grid {
        grid-template-columns: 1fr;
    }

    .site-footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }
}
