/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px; line-height: 1.6; color: #2a2a2a; background: #faf8f5;
    min-height: 100vh; display: flex; flex-direction: column;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 { font-family: 'Cormorant Garamond', serif; font-weight: 600; line-height: 1.2; }

/* ===== HEADER ===== */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(250, 248, 245, 0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.header__inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 72px;
}
.logo { display: flex; align-items: center; gap: 8px; font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 700; color: #1a1a1a; }
.logo__icon { font-size: 24px; }
.nav { display: flex; gap: 32px; }
.nav__link { font-size: 15px; font-weight: 400; color: #555; transition: color .2s; }
.nav__link:hover { color: #8b6914; }
.cart-link { display: flex; align-items: center; gap: 8px; position: relative; font-size: 15px; color: #555; }
.cart-link__icon { font-size: 20px; }
.cart-link__badge {
    position: absolute; top: -6px; right: -8px;
    background: #8b6914; color: #fff; font-size: 11px; font-weight: 600;
    min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
}
.menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; }
.menu-toggle span { width: 24px; height: 2px; background: #333; border-radius: 2px; }

/* ===== HERO ===== */
.hero { padding: 60px 0 40px; text-align: center; }
.hero__title { font-size: clamp(36px, 5vw, 56px); color: #1a1a1a; margin-bottom: 12px; }
.hero__subtitle { font-size: 18px; color: #777; max-width: 560px; margin: 0 auto; }

/* ===== CATALOG ===== */
.catalog { padding: 20px 0 80px; flex: 1; }
.catalog__controls {
    display: flex; justify-content: space-between; align-items: center;
    gap: 24px; margin-bottom: 40px; flex-wrap: wrap;
}
.search-box { position: relative; flex: 1; max-width: 400px; }
.search-box__input {
    width: 100%; padding: 12px 44px 12px 16px;
    border: 1px solid #ddd; border-radius: 8px;
    font-size: 15px; font-family: inherit; background: #fff;
    transition: border-color .2s;
}
.search-box__input:focus { outline: none; border-color: #8b6914; }
.search-box__btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; font-size: 18px; }
.filter-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-tag {
    padding: 8px 16px; border: 1px solid #ddd; border-radius: 20px;
    background: #fff; font-size: 14px; cursor: pointer; transition: all .2s;
    font-family: inherit;
}
.filter-tag:hover { border-color: #8b6914; }
.filter-tag--active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.catalog__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 32px; }
.catalog__empty { text-align: center; padding: 60px 0; color: #999; font-size: 18px; }

/* ===== BOOK CARD ===== */
.book-card { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.04); transition: box-shadow .3s, transform .3s; }
.book-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.08); transform: translateY(-4px); }
.book-card__image { position: relative; aspect-ratio: 3/4; background: #f0ebe3; overflow: hidden; }
.book-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.book-card:hover .book-card__image img { transform: scale(1.05); }
.book-card__sold { position: absolute; top: 12px; right: 12px; background: #c0392b; color: #fff; padding: 4px 12px; border-radius: 4px; font-size: 12px; }
.book-card__body { padding: 20px; }
.book-card__category { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: #8b6914; font-weight: 600; }
.book-card__title { font-size: 22px; margin: 8px 0 4px; }
.book-card__title a { color: #1a1a1a; transition: color .2s; }
.book-card__title a:hover { color: #8b6914; }
.book-card__author { font-size: 14px; color: #666; margin-bottom: 4px; }
.book-card__edition { font-size: 13px; color: #999; margin-bottom: 16px; }
.book-card__footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.book-card__price { flex: 1; }

/* ===== PRICE ===== */
.price { font-size: 20px; font-weight: 600; color: #1a1a1a; font-family: 'Cormorant Garamond', serif; }
.price--lg { font-size: 28px; }
.price-on-request { font-size: 14px; color: #8b6914; font-style: italic; font-weight: 500; }
.price-on-request--lg { font-size: 20px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 24px; border: none; border-radius: 8px;
    font-size: 15px; font-weight: 500; font-family: inherit;
    cursor: pointer; transition: all .2s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--sm { padding: 8px 16px; font-size: 14px; }
.btn--lg { padding: 14px 32px; font-size: 16px; }
.btn--block { width: 100%; margin-bottom: 12px; }
.btn--primary { background: #1a1a1a; color: #fff; }
.btn--primary:hover { background: #8b6914; }
.btn--outline { background: transparent; border: 1px solid #1a1a1a; color: #1a1a1a; }
.btn--outline:hover { background: #1a1a1a; color: #fff; }

/* ===== BOOK DETAIL ===== */
.breadcrumbs { padding: 24px 0; font-size: 14px; color: #999; }
.breadcrumbs a { color: #8b6914; }
.book-detail { padding-bottom: 60px; }
.book-detail__grid { display: grid; grid-template-columns: 400px 1fr; gap: 60px; }
.book-detail__image { border-radius: 12px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.08); aspect-ratio: 3/4; background: #f0ebe3; }
.book-detail__image img { width: 100%; height: 100%; object-fit: cover; }
.book-detail__info { padding-top: 12px; }
.book-detail__category { font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; color: #8b6914; font-weight: 600; }
.book-detail__title { font-size: 40px; margin: 12px 0 8px; color: #1a1a1a; }
.book-detail__author { font-size: 18px; color: #666; margin-bottom: 32px; }
.book-detail__specs { border-top: 1px solid #e5e0d7; border-bottom: 1px solid #e5e0d7; padding: 20px 0; margin-bottom: 32px; }
.spec-row { display: flex; justify-content: space-between; padding: 8px 0; }
.spec-label { color: #999; font-size: 15px; }
.spec-value { color: #1a1a1a; font-size: 15px; font-weight: 500; }
.book-detail__description { margin-bottom: 40px; }
.book-detail__description h3 { font-size: 24px; margin-bottom: 12px; }
.book-detail__description p { font-size: 16px; color: #444; line-height: 1.7; }
.book-detail__purchase { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.book-detail__price { flex: 1; }

/* ===== CART ===== */
.cart-page { padding: 40px 0 80px; flex: 1; }
.cart-page__title { font-size: 40px; margin-bottom: 40px; }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 40px; }
.cart-item {
    display: grid; grid-template-columns: 80px 1fr auto auto; gap: 20px; align-items: center;
    padding: 20px; background: #fff; border-radius: 12px; margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.cart-item__image { width: 80px; height: 100px; border-radius: 8px; overflow: hidden; background: #f0ebe3; }
.cart-item__image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__title { font-size: 20px; color: #1a1a1a; margin-bottom: 4px; }
.cart-item__title:hover { color: #8b6914; }
.cart-item__author { font-size: 14px; color: #666; margin-bottom: 2px; }
.cart-item__edition { font-size: 13px; color: #999; }
.cart-item__remove { background: none; border: none; font-size: 20px; color: #ccc; cursor: pointer; transition: color .2s; padding: 8px; }
.cart-item__remove:hover { color: #c0392b; }
.cart-summary { background: #fff; border-radius: 12px; padding: 28px; height: fit-content; box-shadow: 0 2px 12px rgba(0,0,0,0.04); position: sticky; top: 96px; }
.cart-summary__title { font-size: 24px; margin-bottom: 20px; }
.cart-summary__row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 15px; color: #666; }
.cart-summary__row--total { font-size: 20px; font-weight: 600; color: #1a1a1a; border-top: 1px solid #e5e0d7; margin-top: 12px; padding-top: 16px; }
.cart-summary__note { font-size: 13px; color: #999; margin: 16px 0; line-height: 1.5; }
.cart-empty { text-align: center; padding: 80px 0; }
.cart-empty__icon { font-size: 64px; margin-bottom: 20px; }
.cart-empty h2 { font-size: 28px; margin-bottom: 8px; }
.cart-empty p { color: #999; margin-bottom: 24px; }
.checkout-form { background: #fff; border-radius: 12px; padding: 40px; margin-top: 40px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.checkout-form h2 { font-size: 28px; margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #555; }
.form-group input, .form-group textarea {
    width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px;
    font-size: 15px; font-family: inherit; background: #fff;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: #8b6914; }
.checkout-success { text-align: center; padding: 40px 0; }
.checkout-success h3 { font-size: 28px; color: #27ae60; margin-bottom: 12px; }
.checkout-success p { color: #666; margin-bottom: 24px; }

/* ===== FOOTER ===== */
.footer { background: #1a1a1a; color: #aaa; margin-top: auto; }
.footer__inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding: 60px 0 40px; }
.footer__title { color: #fff; font-size: 20px; margin-bottom: 12px; }
.footer__text { font-size: 14px; line-height: 1.7; color: #888; }
.footer__bottom { border-top: 1px solid #333; padding: 20px 0; text-align: center; font-size: 13px; color: #666; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .book-detail__grid { grid-template-columns: 1fr; gap: 32px; }
    .book-detail__image { max-width: 320px; margin: 0 auto; }
    .cart-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
}
@media (max-width: 640px) {
    .nav { display: none; }
    .menu-toggle { display: flex; }
    .cart-link__text { display: none; }
    .catalog__controls { flex-direction: column; align-items: stretch; }
    .search-box { max-width: none; }
    .footer__inner { grid-template-columns: 1fr; gap: 24px; }
    .book-detail__purchase { flex-direction: column; align-items: stretch; }
    .cart-item { grid-template-columns: 64px 1fr auto; }
    .cart-item__image { width: 64px; height: 80px; }
    .cart-item__price { grid-column: 2 / -1; }
}
