/* ============================================================
   Cook-iQ — Shared Styles for Inner Pages
   ============================================================ */

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

:root {
  --black:     #000000;
  --white:     #ffffff;
  --off-white: #f5f5f7;
  --gray-1:    #1d1d1f;
  --gray-2:    #424245;
  --gray-3:    #6e6e73;
  --gray-4:    #a1a1a6;
  --gray-5:    #d2d2d7;
  --gray-6:    #e8e8ed;
  --gray-7:    #f5f5f7;
  --accent:    #0071e3;
  --radius:    16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --nav-h:     76px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--gray-1);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: var(--nav-h);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: var(--font); }

/* ============================================================
   SHARED NAV
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 900;
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--gray-6);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo img { height: 65px; object-fit: contain; transition: opacity 0.2s; }
.nav-logo img:hover { opacity: 0.8; }

.nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-2);
  padding: 6px 12px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--black); background: var(--gray-7); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-1);
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--gray-7);
  border: 1px solid var(--gray-6);
  transition: background .2s;
}
.nav-user-btn:hover { background: var(--gray-6); }

.nav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--black);
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--gray-1);
  border-radius: 2px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 100px;
  border: 1.5px solid transparent;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
  cursor: pointer;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm { font-size: 13px; padding: 8px 16px; }
.btn-lg { font-size: 17px; padding: 15px 30px; }
.btn-full { width: 100%; }

.btn-black { background: var(--black); color: var(--white); border-color: var(--black); }
.btn-black:hover { background: var(--gray-1); }

.btn-outline { background: transparent; color: var(--black); border-color: var(--gray-5); }
.btn-outline:hover { border-color: var(--black); }

.btn-ghost { background: transparent; color: var(--gray-2); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-7); color: var(--black); }

.btn-danger { background: #ff3b30; color: var(--white); border-color: #ff3b30; }
.btn-danger:hover { background: #e0352b; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-5);
  border-radius: 12px;
  font-size: 15px;
  color: var(--gray-1);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--gray-4); }

.form-textarea { min-height: 100px; resize: vertical; }

.form-hint { font-size: 12px; color: var(--gray-4); }
.form-error { font-size: 12px; color: #ff3b30; }

/* ============================================================
   BADGES & TAGS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.03em;
}

.badge-black { background: var(--black); color: var(--white); }
.badge-gray  { background: var(--gray-6); color: var(--gray-2); }
.badge-green { background: #d4f1d4; color: #1a7a1a; }
.badge-gold  { background: #fff3cd; color: #856404; }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-3);
  background: var(--gray-7);
  border: 1px solid var(--gray-6);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.tag:hover,
.tag.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* ============================================================
   CARDS
   ============================================================ */
.book-card {
  background: var(--white);
  border: 1px solid var(--gray-6);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  border-color: var(--gray-5);
}

.book-cover {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-cover-inner {
  width: 60%;
  aspect-ratio: 3/4;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
}

.book-cover-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.book-cover-chef {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin-top: 6px;
}

.book-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.book-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 4px;
  line-height: 1.3;
}

.book-chef-name {
  font-size: 13px;
  color: var(--gray-3);
  margin-bottom: 10px;
}

.book-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--gray-4);
  margin-bottom: 14px;
}

.book-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.book-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--gray-6);
}

.book-price {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--black);
}

.book-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-2);
}

/* ============================================================
   STARS
   ============================================================ */
.stars {
  display: flex;
  gap: 2px;
  color: #ffc107;
  font-size: 14px;
}

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-header {
  margin-bottom: 40px;
}

.page-title {
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--black);
  margin-bottom: 8px;
}

.page-sub {
  font-size: 16px;
  color: var(--gray-3);
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-3);
  margin-right: 4px;
}

.filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-7);
  border: 1.5px solid var(--gray-6);
  border-radius: 100px;
  padding: 8px 16px;
  transition: border-color .2s;
  min-width: 220px;
}

.filter-search:focus-within {
  border-color: var(--black);
  background: var(--white);
}

.filter-search input {
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--gray-1);
  outline: none;
  width: 100%;
}

.filter-search input::placeholder { color: var(--gray-4); }

.filter-search svg { color: var(--gray-4); flex-shrink: 0; }

.filter-select {
  padding: 8px 14px;
  border: 1.5px solid var(--gray-5);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-2);
  background: var(--white);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color .2s;
}
.filter-select:focus { border-color: var(--black); }

/* ============================================================
   GRID
   ============================================================ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.chef-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ============================================================
   CHEF CARD
   ============================================================ */
.chef-card {
  background: var(--white);
  border: 1px solid var(--gray-6);
  border-radius: 20px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform .3s, box-shadow .3s;
}

.chef-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.1);
}

.chef-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: rgba(255,255,255,0.9);
  margin-bottom: 16px;
  flex-shrink: 0;
}

.chef-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 4px;
}

.chef-specialty {
  font-size: 13px;
  color: var(--gray-3);
  margin-bottom: 12px;
}

.chef-location {
  font-size: 12px;
  color: var(--gray-4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 16px;
}

.chef-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  font-size: 13px;
  color: var(--gray-3);
  padding-top: 16px;
  border-top: 1px solid var(--gray-6);
  width: 100%;
}

.chef-stat strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.02em;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast-wrap {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--black);
  color: var(--white);
  padding: 14px 20px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: toastIn .4s cubic-bezier(0.22,1,0.36,1) forwards;
  max-width: 320px;
  pointer-events: auto;
}

.toast.out { animation: toastOut .35s ease forwards; }

@keyframes toastIn {
  from { opacity:0; transform: translateY(20px) scale(0.95); }
  to   { opacity:1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity:0; transform: translateY(10px) scale(0.95); }
}

/* ============================================================
   LOADING SKELETON
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--gray-7) 25%, var(--gray-6) 50%, var(--gray-7) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--gray-3);
}

.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--gray-1); margin-bottom: 8px; }
.empty-state p { font-size: 15px; }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--white);
  border-radius: 24px;
  padding: 36px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 32px 100px rgba(0,0,0,0.25);
  transform: scale(0.95) translateY(16px);
  transition: transform .35s cubic-bezier(0.22,1,0.36,1);
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gray-7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--gray-3);
  transition: background .2s;
}
.modal-close:hover { background: var(--gray-6); color: var(--black); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--gray-1);
  color: rgba(255,255,255,0.6);
  padding: 40px 24px 24px;
  margin-top: 80px;
}

.footer-bottom-row {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-logo-sm { height: 20px; filter: invert(1); object-fit: contain; }

/* ============================================================
   MOBILE NAV DRAWER
   ============================================================ */
.mobile-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 80%;
  max-width: 320px;
  background: var(--white);
  z-index: 1100;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
}
.mobile-drawer.open { transform: translateX(0); }

.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--gray-6);
}
.mobile-drawer-head img { height: 40px; object-fit: contain; }
.mobile-drawer-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-7);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  cursor: pointer;
  border: none;
  color: var(--gray-2);
  font-family: var(--font);
  transition: background 0.2s;
}
.mobile-drawer-close:hover { background: var(--gray-6); }

.mobile-drawer-links {
  flex: 1;
  overflow-y: auto;
  padding: 12px 12px;
}
.mobile-drawer-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-1);
  text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.mobile-drawer-links a:hover,
.mobile-drawer-links a.active {
  background: var(--gray-7);
  color: var(--black);
}
.mobile-drawer-links .drawer-icon { font-size: 18px; width: 24px; text-align: center; }
.mobile-drawer-divider {
  height: 1px;
  background: var(--gray-6);
  margin: 10px 0;
}

.mobile-drawer-cta {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--gray-6);
}
.mobile-drawer-cta .btn { width: 100%; justify-content: center; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1050;
  display: none;
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { display: block; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav-links  { display: none; }
  .nav-right  { display: none; }
  .nav-cta    { display: none; }
  .nav-toggle { display: flex; margin-left: auto; }

  .books-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .chef-grid  { grid-template-columns: repeat(2, 1fr); }
  .page-wrap  { padding: 20px 16px 60px; }

  .page-title { font-size: 26px; }
  .page-sub   { font-size: 14px; }

  .filter-bar { gap: 8px; flex-wrap: wrap; }
  .filter-search { min-width: 100%; order: -1; }

  .book-card { border-radius: 14px; }
  .book-title { font-size: 14px; }
  .book-price { font-size: 17px; }

  .modal { padding: 24px 20px; border-radius: 20px; }

  .site-footer { padding: 32px 16px 20px; margin-top: 48px; }
}

@media (max-width: 480px) {
  .books-grid  { grid-template-columns: 1fr; }
  .chef-grid   { grid-template-columns: 1fr; }
  .filter-bar  { gap: 6px; }
  .filter-search { min-width: 100%; }
  .btn-lg      { font-size: 15px; padding: 13px 24px; }
  .page-wrap   { padding: 16px 14px 56px; }
}
