/* allow scrolling on this page only */
html, body {
  overflow: auto !important;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;             /* smaller spacing */
  margin-top: 40px;      /* aligns nicer with surrounding layout */
}

/* simpler, flatter items */
.shop-item {
  background: transparent;      /* keep clean */
  border: 1px solid rgba(255,255,255,0.08); /* always-visible thin rectangular border */
  padding: 10px;
  border-radius: 4px;                           /* small rounding, still rectangular */
  text-align: left;             /* align text to left for a tidy card */
  cursor: pointer;
  transition: transform .08s ease, border-color .12s ease, background .12s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shop-item:hover {
  transform: translateY(-2px);
  /* keep border visible on hover without increasing border color */
  background: rgba(255,255,255,0.01);
  box-shadow: none;                         /* remove heavy shadows */
}

/* image slightly smaller, consistent with layout */
.shop-item img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

/* text content aligned and concise */
.shop-item h3 {
  margin: 4px 0 2px;
  font-size: 1rem;
  color: var(--text);
}
.shop-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  min-height: 36px;
}
.shop-price {
  margin-top: 6px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}

/* minimal modal: rely on existing site panel color */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal .box {
  position: relative; /* ensure pseudo-element is positioned relative to box */
  background: var(--panel);
  border-radius: 10px;       /* align modal box rounding with site */
  padding: 20px;             /* more breathing room */
  width: min(1100px, 95vw);  /* larger popup, but limited to viewport */
  max-width: 1100px;
  color: var(--text);
  display: flex;
  gap: 18px;                 /* a bit more gap between image and meta */
  align-items: flex-start;
  border: 1px solid rgba(255,255,255,0.02); /* same thin border as .shop-item */
}

/* image: use natural size up to viewport limits */
.modal .box img {
  width: auto;
  height: auto;
  max-width: 90vw;    /* don't exceed viewport width */
  max-height: 80vh;   /* don't exceed viewport height */
  object-fit: contain;
  border-radius: 10px; /* uniform rounding for modal images */
}

/* meta area: take remaining space */
.modal .box .meta {
  flex: 1;
  min-width: 0;
}

/* adjust backdrop offset for bigger box */
.modal .box::before {
  content: "";
  position: absolute;
  left: -14px;
  top: -14px;
  right: -14px;
  bottom: -14px;
  background: rgba(0, 0, 0, 0.95);
  border-radius: 10px;  /* align with new box radius */
  z-index: -1;
}

/* flatten buttons (no gradients / shadows) */
.modal .btn {
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
}
.modal .btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

/* subtle hover states */
.modal .btn:hover {
  background: rgba(255,255,255,0.02);
}

/* simplified selects alignment */
.product-options {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.product-options select {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 6px 8px;
  border-radius: 6px;
}

/* Keep modal close hidden by default for shop; show on mobile at top-right */
#productModal .modal-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1rem;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1010;
  padding: 6px 8px;
  border-radius: 6px;
}

/* close button inside modal box: visible white [x] top-right */
.modal .box .modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #fff;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  z-index: 1020;
}

/* cart modal tweaks */
.cart-box { max-width: 900px; width: 90vw; }

/* small screens: ensure full width for form/button */
@media (max-width: 720px) {
  .cart-box { width: 95vw; padding: 12px; }
  #cartItems img { width: 56px; height: 56px; }
  /* make modal box full-width and stack content vertically */
  .modal .box {
    flex-direction: column;
    align-items: stretch;        /* stretch content to full width */
    padding: 14px;
    gap: 12px;
    max-width: 95vw;
  }

  /* image takes full width above meta */
  .modal .box img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    border-radius: 10px;
  }

  /* meta area stretches and text reflows nicely */
  .modal .box .meta {
    flex: none;
    width: 100%;
  }

  /* stack action buttons vertically and make them full-width for touch */
  .modal .actions {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .modal .btn {
    width: 100%;
    padding: 12px 10px;
    font-size: 1rem;
    border-radius: 8px;
  }
  .modal .btn.primary {
    width: 100%;
    padding: 12px 10px;
    font-size: 1rem;
  }

  /* increase select/button tap targets inside options */
  .product-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .product-options .product-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }
  .product-options select,
  .product-options .option-button {
    width: 100%;
    padding: 10px;
    font-size: 0.98rem;
  }

  /* ensure shop items maintain spacing on mobile */
  .shop-grid {
    gap: 12px;
    margin-top: 28px;
  }

  /* ensure the close button is visually clear on mobile (subtle hover/tap feedback) */
  #productModal .modal-close:hover {
    background: rgba(255,255,255,0.03);
  }
}


