@charset "UTF-8";

/* =========================================================================
   SALE MODULE DEDICATED STYLESHEET (sale/assets/css/sale.css)
   Bağımsız, taşınabilir ve modüle özel satış motoru stilleri.
   ========================================================================= */

.sale-main-wrapper {
  background: #f6f7fb;
  min-height: 80vh;
  padding: 36px 0 60px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Centered Container for Sale Pages matching site max-w-7xl */
.sale-main-wrapper .container,
.sale-container,
.container {
  width: 100%;
  max-width: 80rem;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .sale-main-wrapper .container,
  .sale-container,
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .sale-main-wrapper .container,
  .sale-container,
  .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* 1. CART & CHECKOUT LAYOUT GRIDS */
.cart-layout-grid, .checkout-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.checkout-steps-col, .checkout-summary-col {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.checkout-summary-col {
  position: sticky;
  top: 90px;
  align-self: start;
}

.checkout-step-card, .checkout-summary-card {
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--gray-200, #e2e8f0);
  padding: 24px;
  box-shadow: var(--shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.checkout-inner-box {
  background: #f8fafc;
  border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 18px;
  margin-bottom: 18px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Saved Address Selector in Checkout */
.saved-addresses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  width: 100%;
  box-sizing: border-box;
}

.saved-address-card {
  border: 2px solid var(--gray-200, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  padding: 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.saved-address-card:hover {
  border-color: var(--primary, #f27a1a);
}

.saved-address-card.selected {
  border-color: var(--primary, #f27a1a);
  background: #fffdfa;
  box-shadow: 0 0 0 1px var(--primary, #f27a1a);
}

.saved-address-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.saved-address-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--dark, #0f172a);
}

.saved-address-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.saved-address-badge.corp {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.saved-address-badge.indiv {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.saved-address-card-body {
  font-size: 12px;
  color: var(--gray-600, #475569);
  line-height: 1.5;
}

/* Invoice Type Segmented Toggle */
.invoice-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-sm, 8px);
  margin-bottom: 16px;
}

.invoice-type-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--gray-600, #475569);
  transition: all 0.2s;
}

.invoice-type-btn.active {
  background: #fff;
  color: var(--primary, #f27a1a);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.form-grid-2 > div, .form-grid-3 > div {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

input, select, textarea {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* 2. CART ITEM CARD (Modern & App-like) */
.cart-item-card {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-100, #f1f5f9);
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

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

.cart-item-thumb {
  width: 76px !important;
  height: 76px !important;
  max-width: 76px !important;
  max-height: 76px !important;
  border-radius: var(--radius-sm, 6px);
  background: #f8fafc;
  border: 1px solid var(--gray-200, #e2e8f0);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cart-item-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-brand {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary, #f27a1a);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cart-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dark, #0f172a);
  line-height: 1.35;
  margin: 0;
  white-space: normal;
}

.cart-item-title a {
  color: inherit;
  text-decoration: none;
}

.cart-item-meta {
  display: flex;
  gap: 12px;
  font-size: 11.5px;
  color: var(--gray-400, #94a3b8);
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 10px;
}

.cart-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--gray-300, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  background: #fff;
  overflow: hidden;
  height: 32px;
  flex-shrink: 0;
}

.cart-qty-stepper a {
  width: 28px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--dark, #0f172a);
  text-decoration: none;
  background: #f8fafc;
  transition: background 0.15s;
}

.cart-qty-stepper a:hover {
  background: var(--gray-200, #e2e8f0);
}

.cart-qty-stepper span {
  width: 30px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--dark, #0f172a);
}

.cart-item-price-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.cart-item-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary, #f27a1a);
  white-space: nowrap;
}

.cart-unit-price {
  font-size: 11px;
  color: var(--gray-400, #94a3b8);
  white-space: nowrap;
}

.cart-remove-btn {
  border: none;
  background: #fef2f2;
  color: #ef4444;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  flex-shrink: 0;
}

.cart-remove-btn:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* 3. PAYMENT METHODS SELECTION & CARDS (2x2 on Mobile, 4x1 on Desktop) */
.payment-methods-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.pay-method-card {
  padding: 12px 6px;
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.pay-method-card .pay-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.pay-method-card .pay-title {
  font-weight: 800;
  font-size: 12px;
  color: var(--dark, #0f172a);
  line-height: 1.25;
}

.pay-method-card .pay-desc {
  font-size: 10.5px;
  color: var(--gray-500, #64748b);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 4. INSTALLMENT (TAKSİT) TABLES */
#installmentsContainer.has-installments {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.installment-empty {
  padding: 16px;
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  color: var(--gray-500);
  background: #f8fafc;
  text-align: center;
}

.installment-box {
  margin-bottom: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.taksit-card {
  border: 1px solid #d9e2f2;
  border-radius: var(--radius-md, 10px);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.taksit-provider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fbff;
  border-bottom: 1px solid #e8ebf1;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
}

.taksit-provider-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary, #f27a1a);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.taksit-provider-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #14213d;
  display: block;
}

.taksit-provider-copy {
  font-size: 0.75rem;
  color: #60708f;
  display: block;
}

.taksit-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.taksit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
  gap: 6px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

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

.taksit-row:hover {
  background: #f8fafc;
}

.taksit-row.active {
  background: #fff7ed;
  font-weight: 700;
  border-left: 3px solid var(--primary, #f27a1a);
}

.taksit-row .d-flex {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.taksit-row .radio-custom {
  margin: 0;
  cursor: pointer;
}

.taksit-row .inst-title {
  font-weight: 700;
  color: #1e293b;
  font-size: 12.5px;
  white-space: nowrap;
}

.taksit-row .inst-formula {
  color: #64748b;
  font-size: 11.5px;
  text-align: center;
  white-space: nowrap;
}

.taksit-row .inst-total {
  font-weight: 800;
  color: var(--primary, #f27a1a);
  font-size: 12.5px;
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 5. RESPONSIVE BREAKPOINTS FOR SALE MODULE */
@media (max-width: 992px) {
  .cart-layout-grid, .checkout-layout-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 16px !important;
  }
  .checkout-summary-col {
    position: static !important;
    top: auto !important;
  }
  .payment-methods-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .checkout-step-card, .checkout-summary-card {
    padding: 16px 12px !important;
    border-radius: var(--radius-md, 10px) !important;
  }
  .checkout-inner-box {
    padding: 14px 10px !important;
  }
}

@media (max-width: 992px) {
  #installmentsContainer.has-installments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #installmentsContainer.has-installments {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sale-main-wrapper {
    padding: 18px 0 40px !important;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }
  .checkout-step-card, .checkout-summary-card {
    padding: 14px 10px !important;
  }
  .checkout-inner-box {
    padding: 12px 8px !important;
  }
  .pay-method-card {
    padding: 10px 4px !important;
  }
  .pay-method-card .pay-title {
    font-size: 11.5px !important;
  }
  .pay-method-card .pay-desc {
    font-size: 10px !important;
  }
  .taksit-row {
    padding: 8px 6px !important;
    font-size: 11.5px !important;
    gap: 4px !important;
  }
  .taksit-row .inst-title {
    font-size: 11px !important;
  }
  .taksit-row .inst-formula {
    font-size: 10px !important;
  }
  .taksit-row .inst-total {
    font-size: 11px !important;
  }
}
