:root {
    --ky-primary: #43aaff;
    --ky-primary-dark: #1f8ae6;
    --ky-ink: #1f2937;
    --ky-muted: #6b7280;
    --ky-bg: #f5f7fb;
}

body {
    font-family: "Barlow", system-ui, sans-serif;
    background: var(--ky-bg);
    color: var(--ky-ink);
}

a { color: var(--ky-primary-dark); }

.text-ky { color: var(--ky-primary) !important; }
.bg-ky { background: var(--ky-primary) !important; }

.btn-ky {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--ky-primary);
    --bs-btn-border-color: var(--ky-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ky-primary-dark);
    --bs-btn-hover-border-color: var(--ky-primary-dark);
    --bs-btn-active-bg: var(--ky-primary-dark);
    --bs-btn-disabled-bg: var(--ky-primary);
    --bs-btn-disabled-border-color: var(--ky-primary);
    font-weight: 600;
}

.btn-outline-ky {
    --bs-btn-color: var(--ky-primary-dark);
    --bs-btn-border-color: var(--ky-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ky-primary);
    --bs-btn-hover-border-color: var(--ky-primary);
    font-weight: 600;
}

/* ---------- Header ---------- */
.site-header {
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, .06);
}

.navbar-brand.ky-brand {
    color: var(--ky-primary);
    font-size: 30px;
    font-weight: 700;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.navbar-brand.ky-brand img { height: 34px; }

.header-icon {
    position: relative;
    color: var(--ky-ink);
    font-size: 1.35rem;
    text-decoration: none;
}

.header-icon:hover { color: var(--ky-primary); }

.header-icon .badge {
    position: absolute;
    top: -6px;
    right: -10px;
    font-size: .65rem;
}

.search-box .form-control { border-radius: 999px 0 0 999px; }
.search-box .btn { border-radius: 0 999px 999px 0; }

/* ---------- Home ---------- */
.promo-carousel img {
    height: 340px;
    object-fit: cover;
}

@media (max-width: 767.98px) {
    .promo-carousel img { height: 160px; }
}

.section-title {
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    font-size: 1.05rem;
}

.category-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem .5rem;
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    color: var(--ky-ink);
    transition: transform .15s, box-shadow .15s;
    height: 100%;
}

.category-chip:hover,
.category-chip.active {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(67, 170, 255, .2);
    color: var(--ky-primary-dark);
}

.category-chip img {
    width: 58px;
    height: 58px;
    padding: .5rem;
    border-radius: 50%;
    border: 2px solid rgba(67, 170, 255, .3);
    object-fit: contain;
}

/* ---------- Product card ---------- */
.book-card {
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    height: 100%;
    transition: transform .15s, box-shadow .15s;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.book-card .cover {
    aspect-ratio: 3 / 4;
    background: #eef3f9;
    position: relative;
}

.book-card .cover img {
    position: absolute;
    inset: .75rem;
    width: calc(100% - 1.5rem);
    height: calc(100% - 1.5rem);
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .18));
}

@media (min-width: 992px) {
    .row-cols-lg-8 > * {
        flex: 0 0 auto;
        width: 12.5%;
    }
}

.book-card .title {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.5em;
}

.book-card .price {
    color: var(--ky-primary-dark);
    font-weight: 700;
}

.book-card .meta { font-size: .78rem; color: var(--ky-muted); }

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- Detail ---------- */
.detail-cover {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.detail-cover img {
    max-height: 440px;
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

.rating-stars { color: #f5b301; }

.qty-input { max-width: 140px; }

/* ---------- Cards & misc ---------- */
.card-soft {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.thumb-sm {
    width: 56px;
    height: 74px;
    object-fit: cover;
    border-radius: 6px;
    background: #eef3f9;
}

.option-card input { display: none; }

.option-card label {
    display: flex;
    align-items: center;
    gap: .75rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: .65rem .9rem;
    cursor: pointer;
    height: 100%;
    background: #fff;
}

.option-card label img {
    height: 26px;
    width: 56px;
    object-fit: contain;
}

.option-card input:checked + label {
    border-color: var(--ky-primary);
    background: rgba(67, 170, 255, .06);
}

.order-timeline .step {
    flex: 1;
    text-align: center;
    font-size: .8rem;
    color: var(--ky-muted);
    position: relative;
}

.order-timeline .step .dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e5e7eb;
    margin: 0 auto .35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.order-timeline .step.done { color: var(--ky-ink); font-weight: 600; }
.order-timeline .step.done .dot { background: var(--ky-primary); }

.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, rgba(67, 170, 255, .25), rgba(67, 170, 255, .05));
}

.avatar-lg {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--ky-primary);
}

/* ---------- Footer ---------- */
.site-footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.site-footer h6 {
    color: var(--ky-primary);
    font-weight: 700;
    text-transform: uppercase;
}

.site-footer .logo-grid img {
    height: 28px;
    width: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 2px;
}
