/* ===== Arena Fan Shop — pages.css : catalog, product, contacts, legal ===== */

/* ---------- CATALOG: sticky filter sidebar + grid ---------- */
.shop-layout {
  display: grid;
  grid-template-columns: 286px 1fr;
  gap: clamp(20px, 3vw, 34px);
  align-items: start;
}

.filters {
  position: sticky;
  top: 92px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.filters h3 { font-size: 1.1rem; margin-bottom: 4px; }
.filters .filter-sub { font-size: .82rem; color: var(--muted); margin-bottom: 16px; }

.filter-group { padding: 16px 0; border-top: 1px solid var(--line); }
.filter-group:first-of-type { border-top: none; padding-top: 0; }
.filter-group > h4 {
  font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--navy); margin-bottom: 12px;
}
.filter-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; cursor: pointer; font-size: .92rem; color: var(--ink);
}
.filter-opt input { width: 18px; height: 18px; accent-color: var(--blue); cursor: pointer; }
.filter-opt .opt-count { margin-left: auto; color: var(--muted); font-size: .8rem; }

.size-chips, .color-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 7px 13px;
  font-weight: 700; font-size: .86rem; color: var(--navy);
  background: #fff; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--blue); }
.chip.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }

.color-chips .chip {
  width: 34px; height: 34px; padding: 0; border-radius: 50%;
  position: relative; overflow: hidden;
}
.color-chips .chip.is-on { box-shadow: 0 0 0 3px var(--blue); border-color: #fff; }
.swatch-blue { background: var(--blue); }
.swatch-red { background: var(--red); }
.swatch-yellow { background: var(--yellow); }
.swatch-white { background: #fff; border-color: #c9cede; }
.swatch-black { background: #1b1f2e; }
.swatch-green { background: var(--green); }

.price-range { display: flex; align-items: center; gap: 10px; }
.price-range input[type="range"] { flex: 1; accent-color: var(--red); }
.price-out { font-weight: 800; font-family: var(--font-head); color: var(--navy); white-space: nowrap; }

.filter-actions { margin-top: 18px; display: grid; gap: 8px; }

/* Catalog toolbar */
.catalog-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}
.catalog-count { font-weight: 700; color: var(--navy); }
.catalog-count b { color: var(--red); }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.sort-select {
  border: 2px solid var(--line); border-radius: var(--radius-pill);
  padding: 9px 16px; font-weight: 700; color: var(--navy); background: #fff;
  cursor: pointer;
}
.filter-toggle { display: none; }

.catalog-empty {
  display: none;
  text-align: center; padding: 50px 20px;
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
}
.catalog-empty.show { display: block; }

/* ---------- PRODUCT PAGE ---------- */
.product-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(24px, 4vw, 50px);
  align-items: start;
}
.gallery .gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--blue-soft);
  aspect-ratio: 1/1;
}
.gallery .gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px;
}
.gallery-thumbs button {
  border-radius: 12px; overflow: hidden; border: 2px solid var(--line);
  aspect-ratio: 1/1; background: var(--blue-soft); transition: .15s;
}
.gallery-thumbs button.is-on { border-color: var(--blue); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.product-info .p-cat { color: var(--blue); font-weight: 700; text-transform: uppercase; font-size: .8rem; letter-spacing: .06em; }
.product-info h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin: 6px 0 10px; }
.product-info .p-rating { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font-size: .9rem; color: var(--muted); }
.product-info .p-rating .star-row { color: var(--yellow); }

.p-price-block { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.p-price-block .price { font-size: 2rem; }
.p-instock { color: var(--green); font-weight: 700; font-size: .9rem; display: flex; gap: 7px; align-items: center; margin-bottom: 20px; }
.p-instock::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }

.p-option { margin-bottom: 18px; }
.p-option .opt-label { font-weight: 800; color: var(--navy); margin-bottom: 9px; display: flex; justify-content: space-between; }
.p-option .opt-label a { font-size: .82rem; color: var(--blue); font-weight: 700; }

.p-actions { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.p-actions .btn { flex: 1 1 200px; }

.qty {
  display: inline-flex; align-items: center;
  border: 2px solid var(--line); border-radius: var(--radius-pill); overflow: hidden;
}
.qty button { width: 44px; height: 46px; font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.qty button:hover { background: var(--blue-soft); }
.qty input { width: 46px; text-align: center; border: none; font-weight: 800; font-size: 1.05rem; color: var(--navy); }

.p-meta { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 10px; }
.p-meta .pm { display: flex; gap: 10px; font-size: .9rem; color: var(--muted); }
.p-meta .pm svg { width: 20px; height: 20px; color: var(--blue); flex: 0 0 auto; }

/* product tabs */
.p-tabs { margin-top: clamp(30px, 4vw, 50px); }
.tab-nav { display: flex; gap: 8px; border-bottom: 2px solid var(--line); flex-wrap: wrap; }
.tab-nav button {
  font-family: var(--font-head); font-weight: 800; color: var(--muted);
  padding: 12px 18px; border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab-nav button.is-on { color: var(--navy); border-color: var(--red); }
.tab-panel { display: none; padding: 24px 0; }
.tab-panel.is-on { display: block; }
.tab-panel p { margin-bottom: 12px; }
.spec-table { width: 100%; border-collapse: collapse; max-width: 560px; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.spec-table th { color: var(--muted); font-weight: 600; width: 45%; }
.spec-table td { color: var(--navy); font-weight: 700; }

/* ---------- CONTACTS ---------- */
.contact-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(22px, 3vw, 40px);
  align-items: start;
}
.contact-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow-sm);
}
.contact-info-list { display: grid; gap: 18px; margin: 6px 0 22px; }
.contact-info-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-info-list .ci-ico {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--blue-soft); color: var(--blue);
}
.contact-info-list .ci-ico svg { width: 22px; height: 22px; }
.contact-info-list .ci-label { font-size: .8rem; color: var(--muted); }
.contact-info-list .ci-value { font-weight: 800; color: var(--navy); }
.contact-info-list a.ci-value:hover { color: var(--blue); }

.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-embed iframe { width: 100%; height: 280px; border: 0; display: block; }

/* Form */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; color: var(--navy); margin-bottom: 7px; font-size: .9rem; }
.field label .req { color: var(--red); }
.field input, .field textarea, .field select {
  width: 100%; border: 2px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--ink); background: #fff; transition: border-color .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); outline: none; }
.field textarea { min-height: 130px; resize: vertical; }
.field.has-error input, .field.has-error textarea { border-color: var(--red); }
.field .err-msg { display: none; color: var(--red); font-size: .82rem; margin-top: 6px; font-weight: 600; }
.field.has-error .err-msg { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-note { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.form-success {
  display: none; background: var(--green); color: #fff;
  padding: 14px 18px; border-radius: 12px; font-weight: 700; margin-bottom: 16px;
}
.form-success.show { display: block; }

/* ---------- LEGAL ---------- */
.legal {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 50px); box-shadow: var(--shadow-sm);
  max-width: 900px; margin: 0 auto;
}
.legal h2 { font-size: 1.4rem; margin: 30px 0 12px; }
.legal h2:first-child { margin-top: 0; }
.legal h3 { font-size: 1.1rem; margin: 20px 0 8px; }
.legal p, .legal li { color: var(--ink); margin-bottom: 12px; line-height: 1.7; }
.legal ul { list-style: disc; padding-left: 22px; margin-bottom: 14px; }
.legal ul li { margin-bottom: 6px; }
.legal .legal-updated { color: var(--muted); font-size: .9rem; margin-bottom: 24px; font-style: italic; }
.legal a { color: var(--blue); text-decoration: underline; }

/* ---------- CART DRAWER (висувна панель) ---------- */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(11,31,77,.5);
  z-index: 150; opacity: 0; visibility: hidden; transition: .25s;
}
.cart-overlay.is-open { opacity: 1; visibility: visible; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 160;
  width: min(92vw, 420px); background: var(--bg);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s ease;
  box-shadow: var(--shadow-lg);
}
.cart-drawer.is-open { transform: translateX(0); }
.cart-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; background: var(--navy); color: #fff;
}
.cart-drawer-head h3 { color: #fff; font-size: 1.15rem; }
.cart-close {
  width: 38px; height: 38px; border-radius: 10px; color: #fff;
  background: rgba(255,255,255,.12); font-size: 1.1rem; font-weight: 700;
}
.cart-close:hover { background: rgba(255,255,255,.22); }
.cart-drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.cart-drawer-foot { padding: 16px; border-top: 1px solid var(--line); background: var(--card); display: grid; gap: 10px; }

.cart-line {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 10px; position: relative;
}
.cart-line-img { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--blue-soft); }
.cart-line-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-name { font-family: var(--font-head); font-weight: 700; font-size: .92rem; color: var(--navy); line-height: 1.2; display: block; padding-right: 18px; }
.cart-line-name:hover { color: var(--blue); }
.cart-line-meta { font-size: .76rem; color: var(--muted); margin: 3px 0 8px; }
.cart-line-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-line-price { font-family: var(--font-head); font-weight: 800; color: var(--navy); }
.cart-line-del {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  color: var(--muted); font-size: .9rem; border-radius: 6px;
}
.cart-line-del:hover { color: var(--red); background: var(--red-soft); }

/* compact qty */
.qty.qty-sm { border-width: 2px; }
.qty.qty-sm button { width: 32px; height: 32px; font-size: 1.1rem; }
.qty.qty-sm span, .qty.qty-sm input { min-width: 30px; width: 30px; text-align: center; font-weight: 800; color: var(--navy); display: inline-grid; place-items: center; }

.cart-ship-note { font-size: .82rem; color: var(--muted); text-align: center; }
.cart-ship-note b { color: var(--red); }
.cart-ship-note.ok { color: var(--green); font-weight: 700; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; font-family: var(--font-head); }
.cart-total span { color: var(--muted); font-weight: 700; }
.cart-total b { font-size: 1.4rem; color: var(--navy); }

/* empty states */
.cart-empty { text-align: center; padding: 30px 16px; }
.cart-empty-ico { font-size: 2.6rem; margin-bottom: 8px; }
.cart-empty h4, .cart-empty h3 { color: var(--navy); margin-bottom: 8px; }
.cart-empty p { margin-bottom: 16px; }
.cart-empty-page { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 50px 20px; }

/* ---------- CART PAGE ---------- */
.cart-page { display: grid; grid-template-columns: 1fr 340px; gap: clamp(20px, 3vw, 34px); align-items: start; }
.cart-items { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px clamp(12px,2vw,22px); box-shadow: var(--shadow-sm); }
.cart-items-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cart-items-head h2 { font-size: 1.2rem; }
.cart-row {
  display: grid; grid-template-columns: 84px 1fr auto auto 28px;
  gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.cart-row:last-child { border-bottom: none; }
.cart-row-img { width: 84px; height: 84px; border-radius: var(--radius-sm); overflow: hidden; background: var(--blue-soft); }
.cart-row-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-row-name { font-family: var(--font-head); font-weight: 700; color: var(--navy); line-height: 1.25; }
.cart-row-name:hover { color: var(--blue); }
.cart-row-meta { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.cart-row-unit { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.cart-row-sum { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; color: var(--navy); white-space: nowrap; }
.cart-row-del { width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.cart-row-del:hover { color: var(--red); background: var(--red-soft); }

.cart-summary, .checkout-summary {
  position: sticky; top: 92px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.cart-summary h3, .checkout-summary h3 { font-size: 1.15rem; margin-bottom: 14px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: .92rem; color: var(--muted); }
.sum-row b { color: var(--navy); }
.sum-total {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  border-top: 1px solid var(--line); margin-top: 8px; padding-top: 14px; margin-bottom: 16px;
  font-family: var(--font-head);
}
.sum-total span { font-weight: 700; color: var(--navy); }
.sum-total b { font-size: 1.5rem; color: var(--red); }
.cart-summary .btn { margin-top: 8px; }

/* ---------- CHECKOUT ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: clamp(20px, 3vw, 34px); align-items: start; }
.checkout-layout.is-empty { grid-template-columns: 1fr; }
.pay-options { display: grid; gap: 10px; }
.pay-opt {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-weight: 600; color: var(--ink); transition: border-color .15s, background .15s;
}
.pay-opt:hover { border-color: var(--blue); }
.pay-opt input { width: 18px; height: 18px; accent-color: var(--blue); }
.pay-opt input:checked ~ span { color: var(--navy); font-weight: 700; }

.checkout-summary .co-line { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.co-line-img { position: relative; width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--blue-soft); }
.co-line-img img { width: 100%; height: 100%; object-fit: cover; }
.co-line-qty { position: absolute; top: -6px; right: -6px; background: var(--navy); color: #fff; font-size: .7rem; font-weight: 800; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px; }
.co-line-name { font-weight: 700; color: var(--navy); font-size: .9rem; line-height: 1.2; }
.co-line-meta { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.co-line-sum { font-family: var(--font-head); font-weight: 800; color: var(--navy); white-space: nowrap; }
.co-sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: .9rem; color: var(--muted); }
.co-sum-row:first-of-type { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.co-sum-row b { color: var(--navy); }
.co-sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px; font-family: var(--font-head); }
.co-sum-total span { font-weight: 700; color: var(--navy); }
.co-sum-total b { font-size: 1.4rem; color: var(--red); }

.order-done { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(30px,5vw,60px); text-align: center; box-shadow: var(--shadow-sm); max-width: 640px; margin: 0 auto; }
.order-done-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--green); color: #fff; font-size: 2.2rem; font-weight: 800; display: grid; place-items: center; margin: 0 auto 18px; }
.order-done h2 { margin-bottom: 12px; }
.order-done p { max-width: 46ch; margin: 0 auto 22px; }
.order-done-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 980px) {
  .cart-page { grid-template-columns: 1fr; }
  .checkout-layout { grid-template-columns: 1fr; }
  .cart-summary, .checkout-summary { position: static; }
  .shop-layout { grid-template-columns: 1fr; }
  .filters {
    position: fixed; inset: 0 0 0 auto; top: 0; width: min(86vw, 360px);
    border-radius: 0; z-index: 80; overflow-y: auto; transform: translateX(100%);
    transition: transform .3s ease;
  }
  .filters.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .filter-toggle { display: inline-flex; }
  .product-layout { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .p-actions .btn { flex: 1 1 100%; }
  .cart-row {
    grid-template-columns: 70px 1fr 28px;
    grid-template-areas: "img main del" "img qty sum";
    row-gap: 10px;
  }
  .cart-row-img { grid-area: img; width: 70px; height: 70px; }
  .cart-row-main { grid-area: main; }
  .cart-row .qty { grid-area: qty; }
  .cart-row-sum { grid-area: sum; text-align: right; }
  .cart-row-del { grid-area: del; }
}
