/* ── Wrapper ──────────────────────────────────────────────────────── */

.wowext-opc-wrap {
  max-width: 1200px;
  margin: 0 auto;
}

.wowext-opc-empty {
  text-align: center;
  padding: 40px 20px;
  color: #646970;
  font-style: italic;
}

/* ── Product grid ────────────────────────────────────────────────── */

.wowext-opc-grid {
  display: grid;
  grid-template-columns: repeat(var(--wowext-opc-columns, 3), 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

/* ── Product list ────────────────────────────────────────────────── */

.wowext-opc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

/* ── Dropdown ────────────────────────────────────────────────────── */

.wowext-opc-dropdown-wrap {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 40px;
}

.wowext-opc-product-select {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

/* ── Product card ────────────────────────────────────────────────── */

.wowext-opc-card {
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wowext-opc-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.wowext-opc-card--selected {
  border-color: #9149fd;
  box-shadow: 0 0 0 1px #9149fd;
}

.wowext-opc-card--list {
  flex-direction: row;
  align-items: center;
}

.wowext-opc-card--list .wowext-opc-card__img {
  width: 80px;
  min-width: 80px;
}

.wowext-opc-card--list .wowext-opc-card__img img {
  height: 80px;
  object-fit: cover;
}

.wowext-opc-card__img img {
  width: 100%;
  height: auto;
  display: block;
}

.wowext-opc-card__body {
  padding: 16px;
  flex: 1;
}

.wowext-opc-card__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #1e1e1e;
}

.wowext-opc-card__desc {
  margin: 0 0 8px;
  font-size: 13px;
  color: #646970;
  line-height: 1.45;
}

.wowext-opc-card__price {
  font-size: 15px;
  font-weight: 600;
  color: #9149fd;
}

.wowext-opc-card__price del {
  color: #9ca3af;
  font-weight: 400;
}

.wowext-opc-card__price ins {
  text-decoration: none;
}

.wowext-opc-card__actions {
  padding: 12px 16px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wowext-opc-card--list .wowext-opc-card__actions {
  border-top: none;
  border-left: 1px solid #f3f4f6;
  flex-direction: column;
  padding: 16px;
  min-width: 130px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.wowext-opc-add {
  background: linear-gradient(45deg, #e953c5, #9149fd) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 8px 20px !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer;
  transition: opacity 0.2s ease;
  width: 100%;
}

.wowext-opc-add:hover {
  opacity: 0.9;
}

.wowext-opc-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wowext-opc-remove {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: none !important;
  border-radius: 6px !important;
  padding: 6px 14px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer;
}

.wowext-opc-remove:hover {
  background: #fecaca !important;
}

/* ── Quantity controls ───────────────────────────────────────────── */

.wowext-opc-card__qty-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.wowext-opc-qty-btn {
  background: #f9fafb;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wowext-opc-qty-btn:hover {
  background: #f3f4f6;
}

.wowext-opc-qty-value {
  min-width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #1e1e1e;
}

/* ── Checkout section ────────────────────────────────────────────── */

.wowext-opc-checkout {
  margin-top: 20px;
}

.wowext-opc-order-review {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
}

/* ── Loading state ───────────────────────────────────────────────── */

.wowext-opc-card--loading {
  opacity: 0.5;
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .wowext-opc-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wowext-opc-card--list {
    flex-direction: column;
  }

  .wowext-opc-card--list .wowext-opc-card__img {
    width: 100%;
  }

  .wowext-opc-card--list .wowext-opc-card__actions {
    border-left: none;
    border-top: 1px solid #f3f4f6;
    flex-direction: row;
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .wowext-opc-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Single product: embedded checkout ───────────────────────────── */

.wowext-opc-single-embed {
  width: 100%;
  margin-top: 1.5rem;
  clear: both;
}

.wowext-opc-single-embed .woocommerce-checkout {
  max-width: 100%;
}

/* Optional two-column hint: gallery vs summary (theme markup varies). */
body.wowext-opc-single-two-column .product {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

body.wowext-opc-single-two-column .product .woocommerce-product-gallery {
  flex: 1 1 320px;
  max-width: 100%;
}

body.wowext-opc-single-two-column .product .summary,
body.wowext-opc-single-two-column .product .entry-summary {
  flex: 1 1 360px;
  max-width: 100%;
}

@media (max-width: 768px) {
  body.wowext-opc-single-two-column .product {
    flex-direction: column;
  }
}
