/* ================= product card ================= */
.product-card {
    width: 200px;
    background: #fff;
    border: 1px solid #e0e0e0; /* fallback static border */
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative; /* needed for SVG border */
}

.product-card-clickable {
    cursor: pointer;
}

.product-card-clickable:hover h3 {
    color: #00b050;
}

.product-card-clickable:hover img {
    opacity: 0.95;
}

.product-card img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    background-color: #fafafa;
    border-bottom: 1px solid #eee;
}

.product-card-content {
    padding: 10px 12px;
    flex-grow: 1;
}

.product-card h3 {
    font-size: 14px;
    color: #222;
    margin: 0 0 6px;
    font-weight: 600;
    height: 30px;
    overflow: hidden;
}

.product-price .price-label {
    font-size: 14px;
    color: #222;
    font-weight: 600;
}

.product-price {
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-price .new-price {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}

.product-price .old-price {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

.add-button, .add-btn {
    width: calc(100% - 20px);
    margin: 10px auto 12px;
    background: #fff;
    border: 1px solid #00b050;
    color: #00b050;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 0;
    text-align: center;
    transition: all 0.2s ease;
}

.add-button:hover, .add-btn:hover {
    background: #00b050;
    color: #fff;
}

.cart-controls {
    width: calc(100% - 20px);
    margin: 10px auto 12px;
    height: 30px;
    background: #fff;
    border: 1px solid #00b050;
    color: #00b050;
    font-weight: 600;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    font-size: 14px;
}

.cart-controls .delete-icon,
.cart-controls .edit-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-controls .delete-icon:hover {
    background-color: red;
    color: #fff;
    border-radius: 50%;
}

.cart-controls .edit-icon:hover {
    background-color: blue;
    color: #fff;
    border-radius: 50%;
}

.cart-controls .qty-display {
    font-weight: 600;
    text-align: center;
}

.edit-icon,
.delete-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  user-select: none;
}

.edit-icon:hover,
.delete-icon:hover {
  background: rgba(0,0,0,0.1);
  border-radius: 50%;
}

/* ================= popup style ================= */
#quantity-picker-popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
#quantity-picker-popup {
  position: relative;
  background: #e6f2ff;
  padding: 20px;
  border-radius: 12px;
  width: 300px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  font-family: Arial, sans-serif;
}
.close-icon {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  background: #e6e6e6;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  line-height: 30px;
}
#quantity-input {
  width: 90%;
  padding: 10px;
  font-size: 16px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.quantity-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.quantity-button {
  background: white;
  border: 1px solid #4da6ff;
  border-radius: 8px;
  padding: 10px 0;
  font-size: 16px;
  cursor: pointer;
}
.quantity-button:hover {
  background: #007bff;
  color: #fff;
}

/* ================= animated border ================= */
.product-card .border-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}

.product-card .border-svg rect {
  fill: none;
  stroke: #00b050; /* border color */
  stroke-width: 2;
  stroke-dasharray: 0;
  stroke-dashoffset: 0;
  rx: 10;
  ry: 10;
  transition: stroke-dashoffset 1s linear;
}
