/* ============================================================
   ВІЛЬНИЙ МАГАЗИН — enhancement layer (v3, surgical)
   The base Tailwind build already carries the full design.
   This file ONLY styles elements injected by shop-v2.js and
   adds a readable scrolled-navbar. NO broad overrides.
   ============================================================ */

/* ---- Skip link (a11y) ---- */
.cof-skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--color-crimson, #962018);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: top 0.2s ease;
}
.cof-skip-link:focus { top: 16px; }

/* ---- Navbar: readable solid state (scrolled / inner pages) ---- */
header.fixed.cof-nav-scrolled {
  background: rgba(248, 244, 236, 0.94) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(20, 17, 14, 0.08);
  box-shadow: 0 1px 16px rgba(20, 17, 14, 0.06);
}
/* dark logo visible, light logo hidden when solid */
header.fixed.cof-nav-scrolled img[alt="Вартість Свободи"],
header.fixed.cof-nav-scrolled img[alt="Cost of Freedom"] { opacity: 1 !important; }
header.fixed.cof-nav-scrolled img[aria-hidden="true"] { opacity: 0 !important; }
/* dark nav text/links + controls when solid */
header.fixed.cof-nav-scrolled nav a,
header.fixed.cof-nav-scrolled a[aria-label],
header.fixed.cof-nav-scrolled button,
header.fixed.cof-nav-scrolled span { color: var(--color-ink, #14110e) !important; }
header.fixed.cof-nav-scrolled nav a:hover { color: var(--color-crimson, #962018) !important; }
header.fixed.cof-nav-scrolled button[aria-label="Кошик"],
header.fixed.cof-nav-scrolled button[aria-label="Cart"],
header.fixed.cof-nav-scrolled button[aria-label="Відкрити меню"],
header.fixed.cof-nav-scrolled button[aria-label="Open menu"] {
  border-color: rgba(20, 17, 14, 0.2) !important;
}

/* ---- Catalog: filter status + empty state ---- */
.cof-catalog-status {
  font-size: 13px;
  color: var(--color-ash, #857c70);
  margin: 0 0 20px;
}
.cof-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  color: var(--color-ash, #857c70);
  font-size: 16px;
}
.cof-out-of-stock { opacity: 0.62; }

/* ---- Product page: variant help + support accordion + mobile ATC ---- */
.cof-variant-help {
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-ash, #857c70);
  margin: 0 0 12px;
}
.cof-product-support {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cof-product-support details {
  border: 1px solid rgba(20, 17, 14, 0.1);
  border-radius: var(--radius-sm, 12px);
  background: rgba(255, 255, 255, 0.5);
  overflow: hidden;
}
.cof-product-support summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-ink, #14110e);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cof-product-support summary::-webkit-details-marker { display: none; }
.cof-product-support summary::after {
  content: "+";
  font-size: 18px;
  color: var(--color-ash, #857c70);
}
.cof-product-support details[open] summary::after { content: "−"; }
.cof-product-support p {
  padding: 0 16px 16px;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(20, 17, 14, 0.7);
}

/* Sticky mobile add-to-cart bar */
.cof-mobile-atc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(248, 244, 236, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(20, 17, 14, 0.1);
  display: none;
}
.cof-mobile-atc button {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-bone, #f8f4ec);
  background: linear-gradient(135deg, var(--color-crimson, #962018), var(--color-crimson-deep, #6f1610));
  cursor: pointer;
}
.cof-mobile-atc button:disabled { opacity: 0.5; }
@media (max-width: 1023px) {
  .cof-mobile-atc { display: block; }
}

/* ---- Checkout: field errors + status + empty cart ---- */
.cof-field-error {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-crimson, #962018);
  min-height: 0;
}
.cof-field-error:empty { display: none; }
.cof-form-status {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--color-ash, #857c70);
}
.cof-form-status:empty { display: none; }
.cof-empty-cart {
  border: 1px solid rgba(20, 17, 14, 0.1);
  border-radius: var(--radius-md, 20px);
  background: rgba(255, 255, 255, 0.55);
  padding: 32px;
  text-align: center;
  margin-bottom: 24px;
}
.cof-empty-cart h2 {
  font-family: var(--font-display, "Unbounded", sans-serif);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--color-ink, #14110e);
}
.cof-empty-cart p {
  margin: 0 0 18px;
  color: var(--color-ash, #857c70);
  font-size: 15px;
}
.cof-empty-cart a {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 12px 26px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  color: var(--color-bone, #f8f4ec);
  background: linear-gradient(135deg, var(--color-crimson, #962018), var(--color-crimson-deep, #6f1610));
}

/* ---- Order outcome note ---- */
.cof-outcome-note {
  margin: 22px auto 0;
  max-width: 44ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-ash, #857c70);
  text-align: center;
}

/* ---- Cookie consent banner ---- */
.cof-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 20px;
  border-radius: var(--radius-md, 20px);
  background: var(--color-char, #080706);
  color: var(--color-bone, #f8f4ec);
  box-shadow: 0 20px 60px rgba(8, 7, 6, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cof-cookie-banner p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(248, 244, 236, 0.85);
}
.cof-cookie-banner a { color: var(--color-brass-light, #d4b56a); }
.cof-cookie-banner > div { display: flex; gap: 10px; }
.cof-cookie-banner button {
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}
.cof-cookie-banner button[data-consent="granted"] {
  background: linear-gradient(135deg, var(--color-crimson, #962018), var(--color-crimson-deep, #6f1610));
  color: var(--color-bone, #f8f4ec);
}
.cof-cookie-banner button[data-consent="denied"] {
  background: transparent;
  color: var(--color-bone, #f8f4ec);
  border-color: rgba(248, 244, 236, 0.28);
}
@media (min-width: 560px) {
  .cof-cookie-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .cof-cookie-banner > div { flex-shrink: 0; }
}

/* ---- Lazy image fade-in ---- */
img.cof-img-loaded { animation: cof-fadein 0.35s ease both; }
@keyframes cof-fadein { from { opacity: 0; } to { opacity: 1; } }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
