html {
  font-size: 16px;
}

* { box-sizing: border-box; }

/* Bez tohohle by libovolná třída co nastavuje "display" (flex/grid/block)
   přebila prohlížečové výchozí chování atributu [hidden] - viz bug s
   .product-art-3d na Produkt.cshtml (sdílená třída .product-art má
   display:flex, což [hidden] jinak nemá šanci přebít). */
[hidden] { display: none !important; }

/* ---------- Vlastní obrázky zákazníka k položce (ProductDetail.AllowsCustomImages) -
   náhledy na detailu produktu, v košíku i v detailu objednávky v adminu,
   proto sdílené tady v site.css. ---------- */
.custom-images-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .4rem;
}
.custom-images-thumbs > a,
.custom-images-thumbs > .custom-images-item {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(74,15,24,.15);
  background: #fff;
}
.custom-images-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Kulaté šipky (karusely na homepage, přepínač Fotka/3D na
   Produkt.cshtml) - sdílené napříč stránkami, proto tady v site.css. ---------- */
.carousel-arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(32,26,23,.12);
}
.carousel-arrow:hover { background: var(--cream-2); }
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-arrow--prev { left: -14px; }
.carousel-arrow--next { right: -14px; }

:root{
  --cream: #faf7f2;
  --cream-2: #f3ede4;
  --paper: #ffffff;
  --wine: #c0392b;
  --wine-2: #9c2e21;
  --gold: #c0392b;
  --gold-deep: #9c2e21;
  --ink: #201a17;
  --ink-soft: #746a63;
  --line: rgba(32,26,23,.12);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Nunito Sans', sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

main { flex: 1 0 auto; }

.page-title {
  font-family: 'Srisakdi', cursive;
  font-weight: 700;
  font-size: 2.025rem;
  color: var(--ink);
  margin: 0 0 1.6rem;
}

a{ color: inherit; text-decoration: none; }

/* ---------- Top utility bar ---------- */
.topbar{
  position: relative;
  background: linear-gradient(90deg, #f0ac95, var(--cream) 45%, #e8917a);
  color: var(--ink);
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 600;
  font-size: .78rem;
  letter-spacing: .02em;
  text-align: center;
  padding: .55rem 1rem;
}

.topbar-admin-link{
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: var(--wine);
  color: #fff;
  padding: .25rem .8rem;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: .06em;
}

/* ---------- Header ---------- */
header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 3vw;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  justify-self: start;
  min-width: 0;
  display: flex;
  gap:24px;
  padding-bottom:12px;
}

.logo-text{
  font-family: 'Srisakdi', cursive;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0;
  color: var(--wine);
  padding-bottom: 0;
}

  .logo img {
    height: 80px;
    max-width: 100%;
    width: auto;
    display: block;
  }

.search {
  width: 100%;
  max-width: 560px;
  justify-self: center;
  position: relative;
}

  .search input {
    width: 100%;
    padding: .7rem 1.1rem .7rem 2.7rem;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--cream);
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    color: var(--ink);
  }

    .search input::placeholder {
      color: var(--ink-soft);
    }

    .search input:focus {
      outline: 2px solid var(--gold-deep);
      outline-offset: 1px;
    }

  .search svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    stroke: var(--ink-soft);
  }

.search-results {
  position: absolute;
  top: calc(100% + .6rem);
  left: 0;
  right: 0;
  background: var(--paper);
  border: 1px solid rgba(74,15,24,.2);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
  overflow: hidden;
  z-index: 500;
  text-align: left;
}
.search-results[hidden] { display: none; }

.search-result {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: .7rem 1.1rem;
  font-family: 'Inter', sans-serif;
  border-bottom: 1px solid rgba(74,15,24,.08);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover,
.search-result.is-active { background: var(--cream-2); }

.search-result-type {
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.search-result-name {
  font-size: .95rem;
  color: var(--ink);
}
.search-result-subtitle {
  font-size: .8rem;
  color: var(--ink-soft);
  margin-left: .4rem;
}

.search-empty {
  margin: 0;
  padding: .9rem 1.1rem;
  font-family: 'Inter', sans-serif;
  font-size: .85rem;
  color: var(--ink-soft);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  justify-self: end;
  font-family: 'Inter', sans-serif;
}

.logout-form { display: contents; }

.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--ink);
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}
.icon-btn:hover{ background: var(--cream-2); }

  .icon-btn svg {
    width: 27px;
    height: 27px;
    stroke: currentColor;
    fill: none;
  }

.cart-count {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--wine);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-container {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  pointer-events: none;
}

.toast {
  font-family: 'Inter', sans-serif;
  font-size: .85rem;
  background: var(--wine-2);
  color: var(--cream);
  padding: .8rem 1.1rem;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  max-width: 320px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Order status badge ---------- */
.status-badge {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: 999px;
  white-space: nowrap;
}
.status-badge.status-nova { background: var(--cream-2); color: var(--ink-soft); }
.status-badge.status-cekanaplatbu { background: #f6e6b8; color: #7a5c07; }
.status-badge.status-zaplacena { background: #dcead9; color: #2e6b2a; }
.status-badge.status-kvyzvednuti { background: #d0ece6; color: #146b5c; }
.status-badge.status-vyzvednuta { background: #d7e4ec; color: #2b5875; }
.status-badge.status-zrusena { background: #f1d6d6; color: var(--wine-2); }
.status-badge.status-vraceno { background: #e8dcf2; color: #5a2d82; }

/* ---------- Age gate ---------- */
body.modal-open{ overflow: hidden; }

.age-gate-overlay{
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20,6,8,.72);
  backdrop-filter: blur(2px);
}

.age-gate-modal{
  position: relative;
  width: 100%;
  max-width: 440px;
  background: radial-gradient(ellipse at 30% 20%, var(--wine) 0%, var(--wine-2) 78%);
  color: var(--cream);
  border: 1px solid rgba(201,162,75,.55);
  border-radius: 6px;
  padding: 2.4rem 2.2rem 2rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}

.age-gate-divider{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin: 0 0 1.1rem;
}
.age-gate-divider .line{ width: 34px; height: 1px; background: var(--gold); }
.age-gate-divider svg{ width: 26px; height: 26px; color: var(--gold); stroke: currentColor; }

.age-gate-modal h2{
  font-family: 'Srisakdi', cursive;
  font-weight: 700;
  font-size: 1.5rem;
  margin: 0 0 .8rem;
  color: var(--cream);
}

.age-gate-modal p{
  font-family: 'Inter', sans-serif;
  font-size: .92rem;
  color: rgba(243,234,217,.85);
  margin: 0 0 1.6rem;
  line-height: 1.5;
}

.age-gate-actions{
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.age-gate-btn{
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: .9rem;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.age-gate-btn-primary{
  background: var(--gold);
  color: var(--wine-2);
}
.age-gate-btn-primary:hover{ background: #d8b563; }

.age-gate-btn-secondary{
  background: transparent;
  color: rgba(243,234,217,.75);
  border: 1px solid rgba(243,234,217,.35);
}
.age-gate-btn-secondary:hover{ background: rgba(255,255,255,.08); }

/* ---------- Custom potvrzovací dialog (náhrada window.confirm) ----------
   Velké dotykové cíle (min. 52px výška tlačítka) - používá se i na POS s
   dotekovým displejem, viz confirm-dialog.js. */
.confirm-dialog-overlay{
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(20,6,8,.6);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
}
.confirm-dialog-overlay.is-visible{
  opacity: 1;
  visibility: visible;
}

.confirm-dialog{
  width: 100%;
  max-width: 420px;
  background: #fff;
  color: var(--ink, #2b1414);
  border-radius: 10px;
  padding: 1.8rem 1.6rem 1.5rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}

.confirm-dialog-message{
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  line-height: 1.5;
  margin: 0 0 1.4rem;
}

.confirm-dialog-input{
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 1.3rem;
  text-align: center;
  padding: .8rem;
  min-height: 52px;
  border: 1px solid rgba(74,15,24,.25);
  border-radius: 8px;
  margin: 0 0 1.4rem;
  box-sizing: border-box;
}

.confirm-dialog-actions{
  display: flex;
  gap: .8rem;
}

.confirm-dialog-btn{
  flex: 1 1 0;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: .95rem 1rem;
  min-height: 52px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.confirm-dialog-btn-confirm{
  background: var(--wine, #4a0f18);
  color: #fff;
}
.confirm-dialog-btn-confirm:hover{ background: var(--wine-2, #3a0c12); }

.confirm-dialog-btn-cancel{
  background: #f1eee9;
  color: var(--ink, #2b1414);
}
.confirm-dialog-btn-cancel:hover{ background: #e6e2db; }



/* ---------- Main navigation ---------- */
nav.main-nav{
  background: var(--paper);
  padding: .8rem 3vw;
  display: flex;
  gap: 1.9rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}
nav.main-nav a{
  font-family: 'Nunito Sans', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  padding: .3rem 0;
  border-bottom: 2px solid transparent;
}
nav.main-nav a.active{
  color: var(--wine);
  border-bottom: 2px solid var(--wine);
}

nav.main-nav a.nav-highlight{
  color: var(--wine);
  font-weight: 700;
  position: relative;
}
nav.main-nav a.nav-highlight::after{
  content: '';
  position: absolute;
  top: -2px;
  right: -10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wine);
}

/* ---------- Footer ---------- */
footer{
  flex-shrink: 0;
  position: relative;
  background: linear-gradient(160deg, #f4c3b3, var(--cream) 55%);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: 'Inter', sans-serif;
  font-size: .85rem;
}

.foot-inner{
  padding: 2.8rem 3vw 1.6rem;
}

.foot-divider{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin: 0 0 1.8rem;
}
.foot-divider .line{ width: 40px; height: 1px; background: var(--wine); }
.foot-divider svg{ width: 14px; height: 14px; }
.foot-grid{
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem 3rem;
  margin-bottom: 2rem;
}
.foot-grid h4{
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink);
  font-size: .85rem;
  margin: 0 0 .8rem;
}
.foot-grid p, .foot-grid a{ display:block; margin: 0 0 .45rem; }
.foot-grid > div{ flex: 0 1 auto; min-width: 160px; }

.foot-legal{
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
  text-align: center;
}
.foot-notice{
  margin: 0 0 .5rem;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .03em;
  color: var(--wine);
}
.foot-bottom{
  margin: 0;
  font-size: .76rem;
  color: var(--ink-soft);
}

@media (max-width: 900px){
  .foot-grid{ justify-content: space-around; row-gap: 1.8rem; }
}

@media (max-width: 560px){
  .foot-grid{
    flex-direction: column;
    align-items: center;
    gap: 1.6rem;
    text-align: center;
  }
}

@media (max-width: 640px) {
  header {
    grid-template-columns: 1fr auto;
    row-gap: .8rem;
  }

  .logo {
    gap: 10px;
    padding-bottom: 0;
  }

    .logo img {
      height: 44px;
    }

  .search {
    grid-column: 1 / -1;
    order: 3;
    max-width: 100%;
    justify-self: stretch;
  }

  nav.main-nav {
    gap: 1rem;
    padding: .8rem 5vw;
  }
}