/* ==========================================================================
   Sharp Solution BD - Components Stylesheet
   (Product Details, Checkout, Modals, Toasts)
   ========================================================================== */

/* Page View Visibility */
.view-container {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.view-container.active-view {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Breadcrumb Navigation */
.breadcrumb-wrap {
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb-wrap a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-light);
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   PRODUCT DETAILS VIEW (Screenshot 2)
   ========================================================================== */
.product-detail-card {
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
}

/* Product Media / Gallery */
.detail-media-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-main-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.detail-main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.detail-thumbnails {
  display: flex;
  gap: 10px;
}

.detail-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background: #f3f4f6;
  transition: var(--transition);
}

.detail-thumb.active,
.detail-thumb:hover {
  border-color: var(--primary);
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Product Info */
.detail-info-box {
  display: flex;
  flex-direction: column;
}

.detail-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  line-height: 1.35;
  margin-bottom: 12px;
}

.detail-pricing-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-current-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}

.detail-old-price {
  font-size: 17px;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 500;
}

.detail-discount-pill {
  background: #fee2e2;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* Primary Action Buttons */
.detail-actions-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-detail-order {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(243, 92, 5, 0.35);
  transition: var(--transition);
}

.btn-detail-order:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-detail-whatsapp {
  width: 100%;
  background: var(--whatsapp);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 3px 10px rgba(0, 138, 68, 0.25);
  transition: var(--transition);
}

.btn-detail-whatsapp:hover {
  background: var(--whatsapp-hover);
}

/* Assurance Notice Box */
.detail-assurance-note {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #166534;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.detail-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.detail-code-row span {
  font-weight: 500;
  color: var(--text-muted);
}

/* Delivery Charges Table */
.detail-delivery-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f9fafb;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid #e5e7eb;
}

.delivery-fee-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: #374151;
  font-weight: 500;
}

.delivery-fee-row strong {
  color: #111827;
  font-weight: 700;
}

/* Tabs: Description / Return Policy */
.detail-tabs-section {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  overflow: hidden;
}

.tabs-nav {
  display: flex;
  background: #f9fafb;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
  color: #4b5563;
  border-bottom: 3px solid transparent;
  transition: var(--transition);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  padding: 20px 24px;
  display: none;
  font-size: 14px;
  color: #374151;
  line-height: 1.7;
}

.tab-content.active {
  display: block;
}

/* ==========================================================================
   ONE-PAGE CHECKOUT VIEW (Screenshot 3)
   ========================================================================== */
.checkout-wrapper {
  margin: 24px 0 40px 0;
}

.checkout-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
}

/* Left Column: Form */
.checkout-form-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.checkout-instruction-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13.5px;
  color: #1e3a8a;
  line-height: 1.45;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 500;
}

.checkout-instruction-banner span {
  color: var(--danger);
  font-weight: 700;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.form-label .required-star {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: #f9fafb;
  font-size: 14px;
  color: #111827;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(243, 92, 5, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 70px;
}

/* Courier Charge Selector (Matching Screenshot 3) */
.courier-charge-section {
  margin: 20px 0;
}

.courier-section-label {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 10px;
  display: block;
}

.courier-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.courier-option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.courier-option-item input[type="radio"] {
  accent-color: #15803d;
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.courier-option-item span {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

/* Active Highlight (Screenshot 3 shows green background for selected charge) */
.courier-option-item.selected {
  background: #008a00;
  border-color: #007000;
  color: #ffffff;
}

.courier-option-item.selected span {
  color: #ffffff;
}

/* Red Confirm Order Button */
.btn-confirm-order {
  width: 100%;
  background: #e60000;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(230, 0, 0, 0.35);
  transition: var(--transition);
  margin-top: 24px;
}

.btn-confirm-order:hover {
  background: #cc0000;
  transform: translateY(-1px);
}

/* Right Column: Order Summary Table */
.order-summary-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.summary-table-header {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
  font-weight: 700;
  color: #374151;
}

.summary-items-list {
  display: flex;
  flex-direction: column;
  max-height: 380px;
  overflow-y: auto;
}

.summary-item-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 8px;
}

.summary-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-item-img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #e5e7eb;
}

.summary-item-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #111827;
  line-height: 1.25;
}

.summary-item-price {
  font-size: 13.5px;
  font-weight: 700;
  color: #374151;
}

/* Quantity Control Buttons */
.qty-control-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid #3b82f6;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  background: #3b82f6;
  color: #ffffff;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
}

.qty-btn:hover {
  background: #2563eb;
}

.qty-val {
  min-width: 24px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  padding: 0 4px;
}

.summary-item-total {
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-remove-item {
  color: #9ca3af;
  font-size: 16px;
  transition: var(--transition);
}

.btn-remove-item:hover {
  color: var(--danger);
}

/* Calculation Rows */
.summary-totals-group {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #4b5563;
  font-weight: 600;
}

.calc-row.total-amount-row {
  font-size: 18px;
  font-weight: 800;
  color: var(--danger);
  padding-top: 10px;
  border-top: 2px dashed #e5e7eb;
}

/* Empty Cart State */
.empty-cart-view {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-cart-icon {
  font-size: 48px;
  color: #d1d5db;
  margin-bottom: 12px;
}

/* ==========================================================================
   ORDER CONFIRMATION MODAL & RECEIPT
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-backdrop.active .modal-card {
  transform: scale(1);
}

.order-success-header {
  text-align: center;
  margin-bottom: 24px;
}

.success-icon-wrap {
  width: 64px;
  height: 64px;
  background: #dcfce7;
  color: #16a34a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px auto;
}

.receipt-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 13.5px;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f3f4f6;
}

.receipt-row:last-child {
  border-bottom: none;
}

.receipt-row strong {
  color: #111827;
}

.receipt-items-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
}

.receipt-items-table th,
.receipt-items-table td {
  padding: 6px 8px;
  text-align: left;
  font-size: 13px;
}

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

.btn-modal-print {
  flex: 1;
  background: #4b5563;
  color: #ffffff;
  font-weight: 700;
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-modal-close {
  flex: 1;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  padding: 10px;
  border-radius: var(--radius-sm);
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-item {
  background: #111827;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .product-detail-grid,
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
