:root {
  --bg: #0f0f0f;
  --card: #181818;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --accent: #ff7a00;

  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.25);
  --overlay: rgba(0,0,0,0.6);
}

* {
  box-sizing: border-box;
}

img {
  user-select: none;
}

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

@media (max-width: 600px) {
  .products {
    grid-template-columns: 1fr 1fr;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .cart-item-info img {
    width: 32px;
    height: 32px;
  }

  .cart-item-info strong {
    max-width: 100px;
  }
}

select {
  appearance: none;          /* прибирає стандартний стиль */
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: #ff8a00; /* помаранчевий (можеш змінити) */
  color: #fff;

  border: 1px solid #e68a00;
  border-radius: 12px;

  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;

  outline: none;

  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'><path fill='white' d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}

select:focus {
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.25);
}

.select-wrapper {
  position: relative;
  display: inline-block;
}

.select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background: #ff7a00;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  padding-right: 40px;
  cursor: pointer;
  font-weight: 600;
  outline: none;

  /* Важливо, щоб select був ширший, ніж стрілка */
  min-width: 160px;
}

.select-wrapper::after {
  content: "▾"; /* стрілка */
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: white;
  pointer-events: none;
}


.products-section {
  margin-bottom: 40px;
}

.products-section h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

.cartModal {
  width: 600px;
  /*max-width: 92vw;*/
  padding: 20px;
  border-radius: 20px;
  background: var(--card);
  color: var(--text);

  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
}

.cart-size {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
}

.cart-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cart-item-left strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-input {
  all: unset;

  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 24px;

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

  padding: 0;

  text-align: center;
  line-height: 1;

  font-size: 0.85rem;
  font-weight: 500;

  color: var(--text);
  background: transparent;

  border-bottom: 1px solid rgba(255,255,255,.3);

  appearance: textfield;
}

.qty-input:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input[type=number] {
  -moz-appearance: textfield;
}

.cart-item-price {
  white-space: nowrap;
  margin-left: auto;
  padding-left: 10px;
}

.cart-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cart-item-info img {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item-info div {
  min-width: 0;
}

.cart-item-info strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.remove-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #888;
}


html, body {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  justify-content: center;

  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.5;
}

.hero, header, footer {
  text-align: center;
}

.main-container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

.skeleton {
  width: 100%;
  height: 200px;
  background: #eee;
  border-radius: 12px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
  animation: shine 1.2s infinite;
}

@keyframes shine {
  0% { left: -50%; }
  100% { left: 100%; }
}

.empty-text {
  color: #777;
  font-style: italic;
  margin-top: 10px;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.product {
  background: var(--card);
  border-radius: var(--radius);
  /*border: 1px solid #e5e5e5;*/
  padding: 16px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
  position: relative;
}

.product:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.product img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.product h3 {
  font-size: 1rem;
  margin: 10px 0 4px;
}

.product p {
  color: var(--muted);
  font-size: .9rem;
}

/* OUT OF STOCK PRODUCT */
.product.out-of-stock {
  opacity: 0.45;
  filter: grayscale(1);
}

.product.out-of-stock img {
  filter: grayscale(1);
}

.product.out-of-stock h3,
.product.out-of-stock p {
  color: #888;
}

.badge-low {
  position: absolute;
  top: 8px;
  left: 8px;
  background: orange;
  color: #000;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 2;
}


/* Кнопка в модалці, коли товару немає */
button.out-of-stock-btn {
  background: #444 !important;
  cursor: not-allowed;
}


/* STATUS */
.status-low {
  color: #ffb703;
  font-size: .8rem;
}

.status-out {
  opacity: .4;
  filter: grayscale(1);
  pointer-events: none;
}

/* OVERLAY */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 10;
}

.overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay.show {
  opacity: 1;
}

/* MODAL */
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;

  width: 100%;
  max-width: 420px;
  max-height: 90vh;

  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;

  box-shadow: var(--shadow);
  opacity: 0;
  transition: .25s ease;
  overflow-y: auto;

  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;

  filter: none !important;
  backdrop-filter: none !important;
}

.modal.show {
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.modal img {
  width: 100%;
}

.modal.out-of-stock img,
.modal.out-of-stock h2,
.modal.out-of-stock p {
  filter: grayscale(1);
  opacity: 0.6;
}

.modal-low {
  margin-top: 6px;
  color: orange;
  font-weight: 600;
  font-size: 14px;
}



.close {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 42px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--bg);
}

.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* BUTTONS */
button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.05);
}

button:active {
  filter: brightness(0.95);
}

button:disabled {
  background: #444;
  cursor: not-allowed;
}

.sizeSelect {
  background: var(--accent);
}

/* CART */
.cart-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 18px;
  z-index: 9;
}

.total {
  font-weight: bold;
  margin-top: 16px;
}

/* CHECKOUT */
.checkout {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  font-size: 16px;
}
