/* ==========================================================================
   Onyx Research — Cart & Checkout Styles
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Toast notification
   --------------------------------------------------------------------------- */
.onyx-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1a1a2e;
  color: #fff;
  padding: 14px 24px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 99999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.onyx-toast-show {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------------------------------------------------
   Mini-cart sidebar
   --------------------------------------------------------------------------- */
.nectar-slide-in-cart.open {
  transform: translateX(0) !important;
  visibility: visible !important;
}
.nectar-slide-in-cart-bg.visible {
  opacity: 1 !important;
  visibility: visible !important;
}

.onyx-mini-empty {
  padding: 30px 20px;
  text-align: center;
  color: #888;
  font-size: 14px;
}

.onyx-mini-items {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.onyx-mini-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
  gap: 12px;
}

.onyx-mini-img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.onyx-mini-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.onyx-mini-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
}

.onyx-mini-qty {
  font-size: 12px;
  color: #888;
}

.onyx-mini-remove {
  background: none;
  border: none;
  font-size: 20px;
  color: #ccc;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.onyx-mini-remove:hover {
  color: #e74c3c;
}

.onyx-mini-total {
  padding: 16px 20px;
  font-size: 15px;
  border-top: 2px solid #eee;
  text-align: right;
}

.onyx-mini-actions {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */
.onyx-btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
  line-height: 1.4;
}
.onyx-btn:hover { opacity: 0.9; }

.onyx-btn-primary {
  background: linear-gradient(135deg, #1a1a2e 0%, #42515D 100%);
  color: #fff;
  flex: 1;
}

.onyx-btn-secondary {
  background: #f5f5f5;
  color: #333;
  flex: 1;
}

/* ---------------------------------------------------------------------------
   Cart page
   --------------------------------------------------------------------------- */
#onyx-cart-container {
  max-width: 960px;
  margin: 40px auto;
  padding: 0 20px;
}

.onyx-cart-empty {
  text-align: center;
  padding: 60px 20px;
}
.onyx-cart-empty h2 {
  margin-bottom: 20px;
  color: #333;
}

.onyx-cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}
.onyx-cart-table th {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 2px solid #eee;
  font-size: 13px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.onyx-cart-table td {
  padding: 16px 8px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.onyx-cart-img img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.onyx-cart-name {
  font-weight: 600;
  font-size: 14px;
}

.onyx-cart-price,
.onyx-cart-line {
  font-size: 14px;
  white-space: nowrap;
}

.onyx-cart-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.onyx-qty-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  background: #f9f9f9;
  font-size: 16px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.onyx-qty-btn:hover { background: #eee; }

.onyx-qty-input {
  width: 45px;
  height: 30px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  -moz-appearance: textfield;
}
.onyx-qty-input::-webkit-outer-spin-button,
.onyx-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.onyx-cart-remove button {
  background: none;
  border: none;
  font-size: 22px;
  color: #ccc;
  cursor: pointer;
}
.onyx-cart-remove button:hover { color: #e74c3c; }

.onyx-cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.onyx-cart-total {
  font-size: 18px;
}

.onyx-cart-actions {
  display: flex;
  gap: 12px;
}

/* ---------------------------------------------------------------------------
   Checkout page
   --------------------------------------------------------------------------- */
.onyx-checkout-wrap {
  max-width: 1060px;
  margin: 40px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
}

@media (max-width: 768px) {
  .onyx-checkout-wrap {
    grid-template-columns: 1fr;
  }
}

.onyx-checkout-form h2 {
  margin-bottom: 24px;
  font-size: 22px;
  color: #1a1a2e;
}

.onyx-field {
  margin-bottom: 16px;
}
.onyx-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #555;
}
.onyx-field input,
.onyx-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 15px;
  background: #fff;
  color: #333;
  box-sizing: border-box;
}
.onyx-field input:focus,
.onyx-field select:focus {
  border-color: #1a1a2e;
  outline: none;
  box-shadow: 0 0 0 2px rgba(26,26,46,0.1);
}

.onyx-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.onyx-card-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}
.onyx-card-section h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

#onyx-card-element {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

#onyx-card-errors {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

#onyx-submit-btn {
  width: 100%;
  margin-top: 24px;
  padding: 16px;
  font-size: 16px;
}
#onyx-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------------------
   Order summary sidebar
   --------------------------------------------------------------------------- */
#onyx-order-summary {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 24px;
  align-self: start;
  position: sticky;
  top: 120px;
}
#onyx-order-summary h3 {
  margin: 0 0 16px;
  font-size: 18px;
  color: #1a1a2e;
}

.onyx-summary-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.onyx-summary-items li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.onyx-summary-img {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.onyx-summary-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.onyx-summary-name {
  font-size: 13px;
  font-weight: 600;
}
.onyx-summary-meta {
  font-size: 12px;
  color: #888;
}
.onyx-summary-line {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.onyx-summary-total {
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 8px;
  font-size: 17px;
  border-top: 2px solid #ddd;
}

/* ---------------------------------------------------------------------------
   Order confirmation page
   --------------------------------------------------------------------------- */
.onyx-confirmation {
  max-width: 600px;
  margin: 60px auto;
  padding: 40px 20px;
  text-align: center;
}
.onyx-confirmation h1 {
  color: #1a1a2e;
  margin-bottom: 16px;
}
.onyx-confirmation p {
  font-size: 16px;
  color: #555;
  margin-bottom: 12px;
}
.onyx-confirmation .onyx-order-number {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 20px 0;
}

/* ---------------------------------------------------------------------------
   Mobile responsive fixes
   --------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .onyx-cart-table th:nth-child(1),
  .onyx-cart-table td:nth-child(1) {
    display: none; /* hide image column on mobile */
  }
  .onyx-cart-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .onyx-cart-actions {
    flex-direction: column;
  }
  .onyx-field-row {
    grid-template-columns: 1fr;
  }
  .onyx-toast {
    left: 20px;
    right: 20px;
    bottom: 20px;
  }
}
