* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f0f2f5;
  color: #121212;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}
.site-header {
  background: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border: 1px solid #e8e8e8;
}
.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cart-toggle {
  display: none;
  border: 1px solid #e2e2e2;
  background: #fff;
  color: #1a1a2e;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.cart-toggle:active {
  transform: translateY(1px);
}
.site-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 10px;
}
.site-logo-mark {
  flex-shrink: 0;
}
.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a1a2e;
  letter-spacing: -0.02em;
}
.brand-sub {
  font-size: 0.85rem;
  color: #666;
  margin-top: 2px;
}
.thumb-slider {
  position: relative;
}
.thumb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: rgba(18, 18, 18, 0.0);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: grid;
  place-items: center;
  cursor: pointer;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.thumb-nav:active {
  transform: translateY(-50%) scale(0.98);
}
.thumb-nav-prev {
  left: 10px;
}
.thumb-nav-next {
  right: 10px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
}
.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #e8e8e8;
}
.meta {
  padding: 10px 12px 14px;
}
.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.price {
  color: #5d2dff;
  font-weight: 800;
  font-size: 22px;
}
.name {
  font-size: 17px;
  font-weight: 800;
  margin: 6px 0;
}
.desc {
  color: #555;
  line-height: 1.35;
  margin: 0 0 10px;
  font-size: 14px;
}
.info {
  color: #555;
  font-size: 13px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.qty-block {
  margin-bottom: 10px;
}
.qty-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #444;
  margin-bottom: 6px;
}
.qty-row {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 160px;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.qty-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: #f3f4f6;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
  flex: 0 0 40px;
  color: #1a1a2e;
}
.qty-btn:active {
  background: #e8e8e8;
}
.qty-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  text-align: center;
  font-size: 17px;
  font-weight: 800;
  color: #1a1a2e;
  appearance: textfield;
}
.meta > * + * {
  margin-top: 8px;
}
.price-row {
  margin-bottom: 0;
}
.name {
  margin: 0;
}
.desc {
  margin: 0;
}
.info {
  margin-bottom: 0;
}
.qty-input:focus {
  outline: none;
  background: #faf8ff;
}
/* Remove number spinners (little up/down buttons) */
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-input[type="number"] {
  -moz-appearance: textfield;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
}
.lightbox[hidden] {
  display: none !important;
}
.lightbox-img {
  max-width: min(980px, 94vw);
  max-height: 88vh;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  background: #111;
  object-fit: contain;
}
.lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(18, 18, 18, 0.35);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(6px);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #fff;
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  padding: 10px 14px;
  cursor: pointer;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
  user-select: none;
}
.lightbox-nav[hidden] {
  display: none !important;
}
.lightbox-prev {
  left: 6px;
}
.lightbox-next {
  right: 6px;
}
.btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.btn-primary {
  background: #5d2dff;
  color: #fff;
}
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
}
.panel {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
  padding: 14px;
  height: fit-content;
}
.lang-switch {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.lang-btn {
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
  padding: 4px 8px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
}
.lang-btn.active {
  background: #5d2dff;
  color: #fff;
  border-color: #5d2dff;
}
.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cart-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #ececec;
  padding: 8px 0;
  font-size: 14px;
}
.cart-list li:last-child {
  border-bottom: none;
}
.cart-line .cart-qty {
  color: #5d2dff;
  font-size: 15px;
  margin-right: 4px;
}
.total {
  margin: 10px 0;
  font-size: 16px;
  font-weight: 800;
}
.field {
  width: 100%;
  padding: 10px;
  border: 1px solid #d7d7d7;
  border-radius: 8px;
  margin-bottom: 8px;
}
.small {
  font-size: 12px;
  color: #666;
}
.status {
  margin-top: 10px;
  min-height: 20px;
  font-size: 13px;
}
.ok {
  color: #0f7a2a;
}
.err {
  color: #b00020;
}
.admin-wrap {
  max-width: 1000px;
  margin: 20px auto;
  padding: 16px;
}
.admin-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 14px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  border-bottom: 1px solid #ececec;
  text-align: left;
  padding: 8px;
  font-size: 14px;
}
.img-small {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f0f0f0;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .cart-toggle {
    display: inline-grid;
    place-items: center;
  }
  .panel {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: min(360px, calc(100vw - 24px));
    max-width: 92vw;
    overflow: auto;
    z-index: 40;
    transform: translateX(calc(100% + 24px));
    transition: transform 220ms ease;
  }
  body.cart-open .panel {
    transform: translateX(0);
  }
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 35;
  }
}

@media (max-width: 360px) {
  .grid {
    grid-template-columns: 1fr;
  }
}
