.portal-cart-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: start;
  margin: 30px 0;
}

.portal-cart {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  overflow: hidden;
}

.portal-cart-head,
.portal-cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 100px 100px 90px;
  gap: 20px;
  align-items: center;
}

.portal-cart-head {
  padding: 18px 24px;
  background: #f8f8f8;
  border-bottom: 1px solid #e7e7e7;
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.portal-cart-item {
  padding: 24px;
  border-bottom: 1px solid #efefef;
}

.portal-cart-item:last-child {
  border-bottom: none;
}

.portal-cart-product {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-width: 0;
}

.portal-cart-thumb {
  width: 96px;
  height: 96px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}

.portal-cart-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-cart-details {
  min-width: 0;
}

.portal-cart-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  line-height: 1.3;
}

.portal-cart-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: #555;
}

.portal-cart-edit {
  font-size: 0.9rem;
  text-decoration: none;
}

.portal-cart-edit:hover {
  text-decoration: underline;
}

.portal-cart-qty input {
  width: 70px;
  max-width: 100%;
  padding: 10px 8px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  text-align: center;
  font: inherit;
}

.portal-cart-price,
.portal-cart-total {
  font-weight: 600;
  color: #222;
}

.portal-cart-remove button {
  padding: 10px 12px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #fff;
  color: #b42318;
  font: inherit;
  cursor: pointer;
}

.portal-cart-remove button:hover {
  background: #fff5f5;
  border-color: #f0c9c9;
}

.portal-cart-summary {
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  padding: 24px;
  position: sticky;
  top: 20px;
}

.portal-cart-summary h3 {
  margin: 0 0 18px;
  font-size: 1.15rem;
}

.portal-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 0;
  font-size: 0.96rem;
  color: #444;
}

.portal-summary-total {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid #ececec;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
}

.portal-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 22px;
}

.portal-btn {
  display: inline-block;
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  transition: 0.15s ease;
  box-sizing: border-box;
}

.portal-btn-primary {
  background: #111;
  color: #fff;
}

.portal-btn-primary:hover {
  background: #000;
  color: #fff;
}

.portal-btn-secondary {
  background: #fff;
  color: #111;
  border: 1px solid #dcdcdc;
}

.portal-btn-secondary:hover {
  background: #f7f7f7;
  color: #111;
}

/* Tablet */
@media (max-width: 1100px) {
  .portal-cart-wrap {
    grid-template-columns: 1fr;
  }

  .portal-cart-summary {
    position: static;
  }
}

/* Mobile cart layout */
@media (max-width: 760px) {
  .portal-cart-head {
    display: none;
  }

  .portal-cart-item {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .portal-cart-product {
    align-items: start;
  }

  .portal-cart-qty,
  .portal-cart-price,
  .portal-cart-total,
  .portal-cart-remove {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .portal-cart-qty::before {
    content: "Qty";
    font-weight: 600;
    color: #666;
  }

  .portal-cart-price::before {
    content: "Price";
    font-weight: 600;
    color: #666;
  }

  .portal-cart-total::before {
    content: "Total";
    font-weight: 600;
    color: #666;
  }

  .portal-cart-remove {
    justify-content: flex-start;
  }
}

.portal-upload-page {
    max-width: 820px;
    margin: 0 auto;
}

.portal-upload-form {
    margin-top: 20px;
}

.portal-upload-box {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 520px;
    border: 2px dashed #bfc7d1;
    border-radius: 18px;
    background: #f8fafc;
    cursor: pointer;
    transition: 0.2s ease;
    margin-bottom: 20px;
}

.portal-upload-box:hover {
    border-color: #7c8aa0;
    background: #f1f5f9;
}

.portal-upload-box input[type="file"] {
    display: none;
}

.portal-upload-box-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

.portal-upload-icon {
    font-size: 48px;
    margin-bottom: 14px;
}

.portal-upload-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.portal-upload-subtitle {
    font-size: 16px;
    color: #5b6470;
}

.portal-upload-actions {
    margin-top: 10px;
}

.portal-message {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.portal-error {
    background: #fee2e2;
    color: #991b1b;
}

.portal-success {
    background: #dcfce7;
    color: #166534;
}

.portal-edit-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 20px;
}

.portal-edit-col {
    flex: 1 1 calc(50% - 12px);
    min-width: 320px;
}

.portal-card {
    border: 1px solid #d9dee5;
    border-radius: 18px;
    padding: 20px;
    background: #fff;
    box-sizing: border-box;
}

#stl_cont {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 420px;
    background: #f5f7fa;
    border-radius: 14px;
    overflow: hidden;
}

.portal-info-box {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e5eaf0;
    border-radius: 14px;
    line-height: 1.8;
}

.portal-form-row {
    margin-bottom: 18px;
}

.portal-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.portal-form input[type="text"],
.portal-form input[type="number"],
.portal-form select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfd6df;
    border-radius: 10px;
    box-sizing: border-box;
    background: #fff;
}

@media (max-width: 768px) {
    .portal-edit-col {
        flex: 1 1 100%;
    }
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
}

.price-value {
    font-size: 1.6rem;
    font-weight: 700;
}