/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
img, video { max-width: 100%; height: auto; display: block; }

:root{
  --bg1:#eccc7c;
  --bg2:#716442;
  --text:#2e2e2e;
  --card:#ffffff;
  --muted:#444;
  --brand:#3d3624;
  --brand-2:#1b5e20;
  --accent:#908054;
  --shadow-sm:0 2px 10px rgba(0,0,0,.06);
  --shadow-md:0 6px 18px rgba(0,0,0,.12);
  --shadow-card:0 0 16px rgba(0,0,0,.10);
  --radius:16px;

  --arrow-size: 12px;
  --arrow-thickness: 3px;
  --arrow-color-home: #fff;   /* na gradientu */
  --arrow-color-local: #333;  /* na bílém pozadí (detail) */

  --danger:#c0392b;
  --success:#1b5e20;
  --border:#e5e5e5;
}

@media (prefers-reduced-motion: reduce){
  * { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
}

body{
  margin:0;
  font-family:"Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background:linear-gradient(90deg, var(--bg1) 10%, var(--bg2) 100%);
  color:var(--text);
  padding:2rem;
  max-width:1024px;
  margin-inline:auto;
}

h1{
  font-size:clamp(1.8rem, 6vw + .5rem, 3rem);
  line-height:1.2;
  display:flex; align-items:center; justify-content:center;
  flex-wrap:wrap; gap:.5rem; margin:0 0 1rem 0;
}

p1{ font-size:95%; display:block; margin-bottom:1rem; } /* vlastní tag */

/* ===== HERO TITLE FIX ===== */
.heroTitle{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:nowrap !important;
  gap:.5rem;
  margin:0 0 1rem 0;
  line-height:1.2;
  font-size:clamp(1.4rem, 5.2vw, 2.4rem);
}
.heroTitle .logo{
  display:inline-block;
  width: clamp(28px, 8vw, 52px);
  height:auto;
  flex:0 0 auto;
}
.heroTitle .title-text{
  white-space:nowrap;
  flex:0 1 auto;
  min-width:0;
}
@media (max-width: 430px){
  .heroTitle{ gap:.4rem; font-size:clamp(1.3rem, 5.6vw, 2rem); }
  .heroTitle .logo{ width: clamp(24px, 7vw, 44px); }
}

/* ===== HOMEPAGE GRID (3–2–1) ===== */
.products{
  display:grid !important;
  gap:1rem;
  grid-template-columns:repeat(3, minmax(0,1fr));
  margin-top:2rem;
}
@media (max-width:1024px){ .products{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:640px){ .products{ grid-template-columns:1fr; } }

.product{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow-sm);
  overflow:hidden;
  text-align:center;
  padding-bottom:1rem;
  transition:transform .25s ease, box-shadow .25s ease;
  position:relative;
}
.product:hover{ transform:translateY(-6px); box-shadow:var(--shadow-md); }

/* obálka obrázku – ribbon držíme uvnitř fotky */
.product > .media-wrap { position: relative; }
.product > .media-wrap img{
  width:100%;
  height:auto;
  display:block;
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.product-content{ padding:1rem; }
.product h2{ margin:.5rem 0 .2rem; font-size:1.2rem; }
.product h3{ font-size:.7rem; color:#c00; letter-spacing:.03em; }
.product p{ color:var(--muted); margin:.3rem 0; }

/* cenovka výrazněji */
.product-content p[style*='font-weight: bold']{ color:#000; }

/* badge „Skladem: X ks“ */
.stock-badge{
  display:block;
  margin-top:.6rem;
  font-size:.9rem;
  font-weight:600;
  color: var(--text);
  background: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

/* ===== COUNTER (+/−) ===== */
.counter{
  display:flex; align-items:center; justify-content:center;
  gap:1rem; margin-top:.8rem;
}
.counter button{
  width:36px; height:36px; font-size:1.2rem;
  border:none; background:var(--accent); color:#fff;
  font-weight:700; cursor:pointer;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  transition:background .25s ease, transform .08s ease, opacity .2s ease;
}
.counter button:focus-visible{ outline:3px solid rgba(0,0,0,.2); outline-offset:2px; }
.counter button:active{ transform:scale(.96); }
.counter button:hover{ background:var(--brand); }
.counter span{ min-width:24px; text-align:center; font-weight:700; }

/* ===== FORM (order) ===== */
.form-section{
  margin-top:3rem;
  background:#fff;
  padding:2rem;
  border-radius:12px;
  box-shadow:var(--shadow-card);
  max-width:600px;
  margin-inline:auto;
}
form{ display:flex; flex-direction:column; gap:1rem; }
.form-row{ display:flex; gap:1rem; }
.form-row > *{ flex:1; min-width:0; }

input, select, textarea, button{
  padding:.75rem;
  border:1px solid #ccc;
  border-radius:8px;
  font-size:1rem;
  width:100%;
  background:#fff;
  color:var(--text);
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible{
  outline:3px solid rgba(0,0,0,.15);
  outline-offset:2px;
}
textarea{ resize:vertical; }

button[type="submit"]{
  background:var(--brand); color:#fff; border:none;
  font-size:1.1rem; font-weight:700; padding:1rem;
  border-radius:10px; transition:background .25s ease, transform .08s ease;
}
button[type="submit"]:hover{ background:var(--brand-2); }
button[type="submit"]:active{ transform:translateY(1px); }

.hidden{ display:none !important; }

/* ===== Toggle šipky ===== */
#toggleFormButton{
  appearance:none; background:none; border:none; cursor:pointer;
  padding:.6rem 1rem; border-radius:999px;
  display:flex; align-items:center; justify-content:center; gap:.5rem;
  margin:1rem auto 0 auto;
}
#toggleFormButton:focus-visible{ outline:3px solid rgba(255,255,255,.6); outline-offset:2px; }
#toggleFormButton span{
  display:inline-block; width:var(--arrow-size); height:var(--arrow-size);
  border:solid var(--arrow-color-home); border-width:0 var(--arrow-thickness) var(--arrow-thickness) 0;
  transform:rotate(-135deg);
  transition:transform .3s ease, border-color .2s ease;
}
#toggleFormButton.open span{ transform:rotate(45deg); }

.gdpr-consent { font-size: 0.7rem; line-height: 1.4; }

.toggleFormButton{
  appearance:none; background:#fff; border:1px solid var(--border); cursor:pointer;
  padding:.5rem .9rem; border-radius:999px;
  display:inline-flex; align-items:center; justify-content:center; gap:.5rem;
  box-shadow:var(--shadow-sm);
}
.toggleFormButton:focus-visible{ outline:3px solid rgba(0,0,0,.15); outline-offset:2px; }
.toggleFormButton span{
  display:inline-block; width:var(--arrow-size); height:var(--arrow-size);
  border:solid var(--arrow-color-local); border-width:0 var(--arrow-thickness) var(--arrow-thickness) 0;
  transform:rotate(-135deg);
  transition:transform .3s ease, border-color .2s ease;
}
.toggleFormButton.open span{ transform:rotate(45deg); }

/* ===== PRODUCT DETAIL WRAPPER ===== */
.product-container{
  display:flex; flex-wrap:wrap; gap:2rem;
  background:#fff; border-radius:var(--radius);
  box-shadow:var(--shadow-card);
  overflow:hidden; padding:2rem; box-sizing:border-box;
}
#product-detail .product-container{ padding:2rem; }
.product-details{ flex:1 1 100%; }
.product-details h1{ margin-top:0; }
.price{ font-size:1.5rem; font-weight:800; margin:1rem 0; }

/* ===== DETAIL LAYOUT ===== */
.product-layout{
  display:flex; gap:2rem; align-items:flex-start; flex-wrap:nowrap;
}
.product-image{ flex:0 0 40%; max-width:40%; }
.product-text { flex:1 1 60%; max-width:60%; }
.product-image img{ width:100%; height:auto; border-radius:8px; }

/* ===== GALLERY ===== */
.galleryData{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:16px;
  align-items:start;
  margin-top:.5rem;
}
.galleryData > *{ display:contents; }
.galleryData img,
.galleryData video{
  width:100%; height:auto;
  border-radius:8px;
  box-shadow:0 0 8px rgba(0,0,0,.2);
  cursor:pointer;
  background:#000;
}

/* ===== RESPONSIVE ===== */
@media (max-width:900px){
  .galleryData{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width:768px){
  body{ padding:1rem; }
  .product-container{ padding:1rem; }
  .product-layout{ flex-wrap:wrap; }
  .product-image, .product-text{ flex:1 1 100%; max-width:100%; }
  .product-image img{ max-width:90vw; margin:0 auto; }
  .galleryData{ grid-template-columns:1fr; }
}
@media (min-width:1200px){
  .product-image img{ max-width:480px; }
}

/* ===== FOOTER ===== */
footer a svg{ transition:transform .25s ease; }
footer a:hover svg{ transform:scale(1.1); }

/* ===== PRODUCT DETAIL – wrapper nahoře ===== */
#product-detail{
  position: relative;
  width: 100%;
  margin: 0 0 2rem 0;
  display: none;
}
#product-detail:empty{ display: none; }
#product-detail:not(:empty){ display: block; }
body.viewing-detail .products { display: none !important; }
body.viewing-detail #mainForm { display: none !important; }
body.viewing-detail #toggleFormButton { display: none !important; }
body.viewing-detail #product-detail{ display: block; }

/* ===== VYPRODÁNO ribbon ===== */
.product .ribbon{
  position:absolute;
  top:10px;
  right:10px;
  z-index:2;
  background:var(--danger);
  color:#fff;
  font-weight:700;
  padding:6px 10px;
  border-radius:6px;
  letter-spacing:.03em;
  box-shadow:0 2px 6px rgba(0,0,0,.2);
}

/* Neutrální „soldout“ – kartu neschovávat ani netlumit */
.product.soldout{
  opacity:1;
  pointer-events:auto;
}

/* skrytí neaktivních (Zobrazit = 0) */
.product.hidden{ display:none !important; }

/* ===== INFO SECTIONS (O mně / GDPR / Podmínky) – Zavírací ✕ ===== */
#o-mne, #gdpr-section, #podminky, #obchodni-podminky{
  position: relative; /* nutné pro absolutní pozici křížku */
}

/* tlačítko ✕ */
.section-close{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;
  font-weight: 800;
  line-height: 1;

  background: rgba(0,0,0,.06);
  color: #333;

  transition: transform .08s ease, background .2s ease, opacity .2s ease;
}

.section-close:hover{
  background: rgba(0,0,0,.12);
}

.section-close:active{
  transform: scale(.96);
}

.section-close:focus-visible{
  outline: 3px solid rgba(0,0,0,.18);
  outline-offset: 2px;
}

/* aby se text nezačínal "pod křížkem" */
#o-mne h2, #gdpr-section h2, #podminky h2, #obchodni-podminky h2{
  padding-right: 52px;
}
