/**
 * ChabokMart Frontend Styles
 *
 * Uses CSS logical properties for native RTL/LTR support.
 *
 * @package ChabokMart
 */

/* ==========================================================================
   Box Sizing Reset
   ========================================================================== */

.chabokmart-wrapper,
.chabokmart-wrapper *,
.chabok-mini-cart,
.chabok-mini-cart * {
  box-sizing: border-box;
}

/* ==========================================================================
   Wrapper
   ========================================================================== */

.chabokmart-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.chabokmart-content {
  width: 100%;
}

/* ==========================================================================
   Shop Header
   ========================================================================== */

.chabok-shop-header {
  margin-bottom: 30px;
  text-align: center;
}

.chabok-shop-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: #1f2937;
}

/* ==========================================================================
   Product Grid
   ========================================================================== */

.chabok-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
}

/* ==========================================================================
   Product Card
   ========================================================================== */

.chabok-product-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.chabok-product-card:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.chabok-product-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
}

.chabok-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.chabok-product-card:hover .chabok-product-image img {
  transform: scale(1.05);
}

.chabok-product-badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 1;
}

.chabok-badge-sale {
  background: #ef4444;
  color: #fff;
}

.chabok-badge-outofstock {
  background: #6b7280;
  color: #fff;
}

.chabok-product-details {
  padding: 16px;
}

.chabok-product-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.chabok-product-category {
  display: inline-block;
  padding: 2px 8px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 4px;
  font-size: 11px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.chabok-product-category:hover {
  background: #e5e7eb;
  color: #374151;
}

.chabok-product-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.chabok-product-title a {
  color: #1f2937;
  text-decoration: none;
}

.chabok-product-title a:hover {
  color: #2271b1;
}

.chabok-product-sku {
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 6px;
}

.chabok-product-price {
  margin-bottom: 8px;
}

.chabok-price-regular {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.chabok-price-sale {
  font-size: 18px;
  font-weight: 700;
  color: #ef4444;
}

.chabok-price-old {
  font-size: 14px;
  color: #9ca3af;
  text-decoration: line-through;
  margin-inline-end: 8px;
}

.chabok-stock-status {
  font-size: 13px;
  margin-bottom: 10px;
}

.chabok-stock-in-stock {
  color: #059669;
}

.chabok-stock-out-of-stock {
  color: #dc2626;
}

.chabok-product-actions {
  margin-top: 8px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.chabok-button {
  display: inline-block;
  padding: 10px 20px;
  background: #2271b1;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.chabok-button:hover {
  background: #135e96;
  color: #fff;
  text-decoration: none;
}

.chabok-button-outline {
  background: transparent;
  color: #2271b1;
  border: 2px solid #2271b1;
}

.chabok-button-outline:hover {
  background: #2271b1;
  color: #fff;
}

.chabok-add-to-cart {
  width: 100%;
}

.chabok-button:disabled,
.chabok-add-to-cart:disabled {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  border-color: #e2e8f0 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 0.7;
}

.chabok-button-primary {
  background: #0f172a;
  color: #fff;
  border: none;
}

.chabok-button-primary:hover {
  background: #1e293b;
  color: #fff;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.chabok-pagination {
  text-align: center;
  margin: 30px 0;
}

.chabok-pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 3px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s ease;
}

.chabok-pagination .page-numbers.current {
  background: #2271b1;
  color: #fff;
  border-color: #2271b1;
}

.chabok-pagination .page-numbers:hover:not(.current) {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.chabok-empty-shop {
  text-align: center;
  padding: 60px 20px;
}

.chabok-empty-shop p {
  font-size: 18px;
  color: #6b7280;
  margin-bottom: 20px;
}

.chabok-empty-cart-state {
  text-align: center;
  padding: 48px 20px;
}

.chabok-empty-cart-state svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.chabok-empty-cart-state p {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 20px;
}

/* ==========================================================================
   Single Product Page
   ========================================================================== */

.chabok-single-product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.chabok-single-main-image {
  position: relative;
}

.chabok-single-main-image img {
  width: 100%;
  border-radius: 12px;
}

.chabok-single-main-image .chabok-product-badge {
  top: 12px;
  inset-inline-end: 12px;
  font-size: 14px;
  padding: 6px 14px;
}

.chabok-single-gallery-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chabok-gallery-thumbnail {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s ease;
}

.chabok-gallery-thumbnail:hover,
.chabok-gallery-thumbnail.active {
  border-color: #2271b1;
}

.chabok-gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chabok-single-details h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.chabok-single-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.chabok-single-categories .chabok-product-category {
  font-size: 12px;
  padding: 3px 10px;
}

.chabok-single-meta {
  margin-bottom: 20px;
  padding: 12px 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #6b7280;
}

.chabok-single-meta strong {
  color: #374151;
}

.chabok-single-price {
  margin-bottom: 20px;
}

.chabok-single-short-description {
  margin-bottom: 20px;
  line-height: 1.7;
  color: #4b5563;
}

.chabok-single-physical-details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 13px;
}

.chabok-single-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.chabok-single-quantity {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

.chabok-single-quantity .chabok-qty-btn {
  width: 40px;
  height: 44px;
  border: 0;
  border-radius: 0;
  background: #f9fafb;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chabok-single-quantity .chabok-qty-btn:hover {
  background: #f3f4f6;
}

.chabok-single-quantity .chabok-qty-input {
  width: 50px;
  height: 44px;
  border: 0;
  border-inline-start: 1px solid #d1d5db;
  border-inline-end: 1px solid #d1d5db;
  border-radius: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  -moz-appearance: textfield;
}

.chabok-single-quantity .chabok-qty-input::-webkit-outer-spin-button,
.chabok-single-quantity .chabok-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.chabok-single-add-to-cart {
  flex: 1;
  padding: 12px 24px;
  font-size: 15px;
}

.chabok-single-tags {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chabok-tag {
  display: inline-block;
  padding: 3px 10px;
  background: #f3f4f6;
  color: #6b7280;
  border-radius: 20px;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.chabok-tag:hover {
  background: #e5e7eb;
  color: #374151;
}

.chabok-single-description {
  max-width: 800px;
  margin: 40px auto 0;
  padding-top: 30px;
  border-top: 1px solid #e5e7eb;
}

.chabok-single-description h2 {
  font-size: 22px;
  margin-bottom: 16px;
}

.chabok-product-description {
  line-height: 1.8;
  color: #374151;
}

/* ==========================================================================
   Cart Page
   ========================================================================== */

.chabok-cart-page {
  max-width: 900px;
  margin: 0 auto;
}

.chabok-cart-title {
  font-size: 28px;
  margin-bottom: 24px;
}

/* ==========================================================================
   Cart Items - Clean List
   ========================================================================== */

.chabok-cart-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 30px;
}

.chabok-cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  transition: border-color 0.15s ease;
}

.chabok-cart-item:hover {
  border-color: #e2e8f0;
}

.chabok-cart-item-image {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.chabok-cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chabok-cart-item-info {
  flex: 1;
  min-width: 0;
}

.chabok-cart-item-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.chabok-cart-item-title a {
  color: #0f172a;
  text-decoration: none;
}

.chabok-cart-item-title a:hover {
  color: #2271b1;
}

.chabok-cart-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.chabok-cart-item-meta del {
  font-size: 13px;
  color: #94a3b8;
}

.chabok-cart-item-meta ins {
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.chabok-cart-item-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
}

/* Quantity */
.chabok-cart-item-qty {
  display: flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.chabok-cart-item-qty .chabok-qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: all 0.15s ease;
}

.chabok-cart-item-qty .chabok-qty-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.chabok-cart-item-qty .chabok-qty-input {
  width: 44px;
  height: 32px;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  -moz-appearance: textfield;
}

.chabok-cart-item-qty .chabok-qty-input::-webkit-outer-spin-button,
.chabok-cart-item-qty .chabok-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Subtotal */
.chabok-cart-item-subtotal {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  min-width: 80px;
  text-align: right;
}

/* Remove */
.chabok-cart-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.chabok-cart-item-remove:hover {
  background: #fef2f2;
  color: #ef4444;
}

/* ==========================================================================
   Shared Section Box (Cart Summary, Checkout Summary, Coupon, Shipping, Payment)
   ========================================================================== */

.chabok-section-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chabok-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.chabok-section-header svg {
  color: #2271b1;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.chabok-section-header span {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.chabok-section-body {
  padding: 20px;
}

.chabok-section-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #f1f5f9;
  background: #f8fafc;
  border-radius: 0 0 14px 14px;
}

.chabok-section-footer .chabok-button {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
}

/* ==========================================================================
   Summary Rows (shared)
   ========================================================================== */

.chabok-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  color: #334155;
}

.chabok-summary-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475569;
  font-weight: 500;
}

.chabok-summary-label svg {
  color: #94a3b8;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.chabok-summary-value {
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}

.chabok-summary-savings .chabok-summary-value {
  color: #059669;
}

.chabok-summary-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 12px 0;
}

.chabok-summary-total-row {
  padding-top: 16px !important;
}

.chabok-summary-total-row .chabok-summary-label {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.chabok-summary-total-value {
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

/* ==========================================================================
   Checkout Summary Box
   ========================================================================== */

.chabok-checkout-summary-box {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chabok-checkout-summary-box .chabok-summary-row {
  padding: 12px 20px;
}

.chabok-checkout-summary-box .chabok-summary-row:first-child {
  padding-top: 0;
}

.chabok-checkout-summary-box .chabok-summary-divider {
  margin: 0 20px;
}

.chabok-checkout-summary-box .chabok-summary-total-row {
  padding: 16px 20px !important;
  background: #f8fafc;
}

.chabok-coupon-code-badge {
  display: inline-block;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-inline-start: 8px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Coupon Section
   ========================================================================== */

.chabok-coupon-section {
  margin: 20px 0;
}

.chabok-coupon-section .chabok-section-body {
  padding: 16px 20px;
}

.chabok-coupon-input-group {
  display: flex;
  gap: 8px;
}

.chabok-coupon-input-group input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.2s ease;
}

.chabok-coupon-input-group input:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
  background: #fff;
}

.chabok-coupon-message {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
}

.chabok-coupon-message.success {
  color: #059669;
}

.chabok-coupon-message.error {
  color: #ef4444;
}

/* Remove Coupon Button */
.chabok-remove-coupon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  margin-inline-start: 6px;
  border: none;
  background: none;
  color: #94a3b8;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
  vertical-align: middle;
}

.chabok-remove-coupon:hover {
  background: #fef2f2;
  color: #ef4444;
}
/* ==========================================================================
   Shipping Section
   ========================================================================== */

.chabok-shipping-section {
  margin: 20px 0;
}

.chabok-shipping-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chabok-shipping-method:last-child {
  border-bottom: none;
}

.chabok-shipping-method:hover {
  background: #fafbfc;
}

.chabok-shipping-method:has(input:checked) {
  background: #eff6ff;
  border-inline-start: 3px solid #2271b1;
  border-radius: 10px;
}

.chabok-shipping-method input[type="radio"] {
  accent-color: #2271b1;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.chabok-shipping-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.chabok-shipping-cost {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.chabok-shipping-cost del {
  font-size: 12px;
  color: #94a3b8;
  margin-inline-end: 8px;
}

.chabok-shipping-cost strong {
  color: #059669;
}

/* ==========================================================================
   Payment Method - Minimal Clean Card
   ========================================================================== */

.chabok-payment-section {
  margin: 20px 0;
}

.chabok-payment-method {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chabok-payment-method:last-child {
  border-bottom: none;
}

.chabok-payment-method:hover {
  background: #fafbfc;
}

/* Selected State */
.chabok-payment-method:has(input:checked) {
  background: #f8fafc;
}

/* Hide native radio */
.chabok-payment-method input[type="radio"] {
  accent-color: #0f172a;
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Payment Info */
.chabok-payment-info {
  flex: 1;
  min-width: 0;
}

.chabok-payment-title {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.chabok-payment-description {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Payment Icon */
.chabok-payment-icon {
  flex-shrink: 0;
}

.chabok-payment-icon img {
  max-height: 24px;
  max-width: 48px;
  object-fit: contain;
  opacity: 0.7;
}

.chabok-payment-method:has(input:checked) .chabok-payment-icon img {
  opacity: 1;
}

/* ==========================================================================
   Checkout Form Fields
   ========================================================================== */

.chabok-checkout-page {
  max-width: 1100px;
  margin: 0 auto;
}

.chabok-checkout-title {
  font-size: 28px;
  margin-bottom: 24px;
}

/* ==========================================================================
   Checkout Form - Two Column Fields
   ========================================================================== */

.chabok-checkout-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Full width for textarea, notes, and hidden fields */
.chabok-checkout-fields .chabok-field:has(textarea),
.chabok-checkout-fields .chabok-field:has(input[type="hidden"]),
.chabok-checkout-fields .chabok-field-full {
    grid-column: 1 / -1;
}

/* Responsive - Stack on mobile */
@media screen and (max-width: 768px) {
    .chabok-checkout-fields {
        grid-template-columns: 1fr;
    }
}

.chabok-field {
  position: relative;
}

.chabok-field label {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.chabok-field label .required {
  color: #ef4444;
  font-size: 16px;
  line-height: 1;
}

.chabok-field input[type="text"],
.chabok-field input[type="email"],
.chabok-field input[type="tel"],
.chabok-field input[type="number"],
.chabok-field input[type="url"],
.chabok-field input[type="date"],
.chabok-field select,
.chabok-field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  transition: all 0.2s ease;
  box-sizing: border-box;
  line-height: 1.5;
  font-family: inherit;
}

.chabok-field input:focus,
.chabok-field select:focus,
.chabok-field textarea:focus {
  outline: none;
  border-color: #2271b1;
  box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
  background: #fff;
}

.chabok-field input:hover,
.chabok-field select:hover,
.chabok-field textarea:hover {
  border-color: #cbd5e1;
}

.chabok-field textarea {
  resize: vertical;
  min-height: 80px;
}

.chabok-field select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.chabok-field.has-error input,
.chabok-field.has-error select,
.chabok-field.has-error textarea {
  border-color: #ef4444;
  background: #fef2f2;
}

.chabok-field.has-error input:focus,
.chabok-field.has-error select:focus,
.chabok-field.has-error textarea:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.chabok-field-error {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: #ef4444;
  font-weight: 500;
}

.chabok-field-static {
  display: block;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #475569;
}

/* ==========================================================================
   Terms & Conditions
   ========================================================================== */

.chabok-terms-field {
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 16px;
}

.chabok-terms-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
}

.chabok-terms-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2271b1;
  flex-shrink: 0;
}

.chabok-terms-field a {
  color: #2271b1;
  font-weight: 600;
  text-decoration: underline;
}

/* ==========================================================================
   Checkout Submit
   ========================================================================== */

.chabok-checkout-actions {
  margin-top: 24px;
}

.chabok-checkout-submit {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.chabok-checkout-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  background: linear-gradient(135deg, #2271b1 0%, #1e5f8a 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(34, 113, 177, 0.25);
}

.chabok-checkout-button:hover {
  background: linear-gradient(135deg, #1e5f8a 0%, #2271b1 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(34, 113, 177, 0.35);
}

.chabok-checkout-loader {
  font-size: 14px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chabok-checkout-loader::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #e2e8f0;
  border-top-color: #2271b1;
  border-radius: 50%;
  animation: chabok-spin 0.6s linear infinite;
}

@keyframes chabok-spin {
  to {
    transform: rotate(360deg);
  }
}

.chabok-checkout-errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.chabok-checkout-errors ul {
  margin: 0;
  padding-inline-start: 20px;
  color: #dc2626;
  font-size: 14px;
}

/* ==========================================================================
   Unified Checkout Layout
   ========================================================================== */

.chabok-unified-checkout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Unified Cart Mini Items */
.chabok-unified-cart .chabok-cart-item {
  padding: 12px;
  margin-bottom: 8px;
  gap: 12px;
}

.chabok-unified-cart .chabok-cart-item-image {
  width: 56px;
  height: 56px;
}

.chabok-unified-cart .chabok-cart-item-title {
  font-size: 13px;
}

.chabok-unified-cart .chabok-cart-item-meta {
  font-size: 13px;
}

.chabok-unified-cart .chabok-cart-item-qty .chabok-qty-btn {
  width: 28px;
  height: 28px;
}

.chabok-unified-cart .chabok-cart-item-qty .chabok-qty-input {
  width: 40px;
  height: 28px;
  font-size: 13px;
}

.chabok-unified-cart .chabok-cart-item-subtotal {
  font-size: 14px;
}

.chabok-unified-cart .chabok-cart-item-remove {
  width: 28px;
  height: 28px;
}

/* ==========================================================================
   OTP Section
   ========================================================================== */

.chabok-otp-section {
  margin-top: 10px;
  padding: 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
}

.chabok-otp-message {
  display: inline-block;
  margin-inline-start: 10px;
  font-size: 13px;
  font-weight: 500;
}

.chabok-otp-message.success {
  color: #16a34a;
}

.chabok-otp-message.error {
  color: #dc2626;
}

.chabok-otp-timer {
  font-size: 12px;
  color: #6b7280;
}

.chabok-resend-otp {
  background: none;
  border: 0;
  color: #2271b1;
  cursor: pointer;
  font-size: 13px;
  text-decoration: underline;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.chabok-notice {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.chabok-notice-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.chabok-notice-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.chabok-floating-notice {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  pointer-events: none;
}

.chabok-floating-notice.chabok-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
}

/* ==========================================================================
   Sticky Cart Bar Mobile
   ========================================================================== */

.chabok-sticky-cart-bar {
  display: none;
  position: fixed;
  bottom: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  padding: 10px 16px;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
}

.chabok-sticky-cart-bar .chabok-button {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
}

.chabok-sticky-cart-bar .chabok-cart-total-mobile {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  white-space: nowrap;
}

/* ==========================================================================
   Mini Cart
   ========================================================================== */

.chabok-mini-cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #1f2937;
  cursor: pointer;
}

.chabok-mini-cart-toggle:hover {
  color: #2271b1;
}

.chabok-cart-icon {
  display: flex;
  align-items: center;
}

.chabok-cart-count {
  position: absolute;
  top: -8px;
  inset-inline-end: -12px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.chabok-mini-cart-overlay {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.chabok-mini-cart-overlay.open {
  visibility: visible;
  opacity: 1;
}

.chabok-mini-cart {
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  visibility: hidden;
}

.chabok-mini-cart.open {
  visibility: visible;
  animation: chabok-slide-in 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.chabok-mini-cart:not(.open) {
  animation: chabok-slide-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes chabok-slide-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes chabok-slide-out {
  from {
    transform: translateX(0);
    visibility: visible;
  }
  to {
    transform: translateX(100%);
    visibility: hidden;
  }
}

[dir="rtl"] .chabok-mini-cart.open {
  animation-name: chabok-slide-in-rtl;
}

[dir="rtl"] .chabok-mini-cart:not(.open) {
  animation-name: chabok-slide-out-rtl;
}

@keyframes chabok-slide-in-rtl {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes chabok-slide-out-rtl {
  from {
    transform: translateX(0);
    visibility: visible;
  }
  to {
    transform: translateX(-100%);
    visibility: hidden;
  }
}

.chabok-mini-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.chabok-mini-cart-header h3 {
  margin: 0;
  font-size: 18px;
}

.chabok-mini-cart-close {
  background: none;
  border: 0;
  font-size: 28px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.chabok-mini-cart-close:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.chabok-mini-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.chabok-mini-cart-body .chabok-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid #f1f5f9;
}

.chabok-mini-cart-body .chabok-cart-item-image {
  width: 56px;
  height: 56px;
}

.chabok-mini-cart-body .chabok-cart-item-image img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
}

.chabok-mini-cart-body .chabok-cart-item-title {
  font-size: 13px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chabok-mini-cart-body .chabok-cart-item-meta {
  font-size: 13px;
  margin-bottom: 2px;
}

.chabok-mini-cart-body .chabok-cart-item-subtotal,
.chabok-mini-cart-body .chabok-cart-item-qty {
  display: none;
}

.chabok-mini-cart-body .chabok-cart-item-remove {
  width: 28px;
  height: 28px;
  border: 1px solid #fee2e2;
  border-radius: 8px;
}

.chabok-mini-cart .chabok-empty-cart {
  padding: 30px 20px;
  text-align: center;
}

.chabok-mini-cart .chabok-empty-cart p {
  font-size: 14px;
}

.chabok-mini-cart-footer {
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

.chabok-mini-cart-footer .chabok-button {
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

body.chabok-mini-cart-open {
  overflow: hidden;
}

/* ==========================================================================
   Catalog Mode
   ========================================================================== */

.chabok-catalog-mode .chabok-add-to-cart,
.chabok-catalog-mode .chabok-product-price {
  display: none;
}

/* ==========================================================================
   Shop Toolbar
   ========================================================================== */

.chabokmart-wrapper .chabok-shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.chabokmart-wrapper .chabok-shop-count {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.chabok-shop-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chabok-shop-sorting {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chabok-instock-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #475569;
  padding: 0 14px;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
}

.chabok-instock-toggle:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.chabok-instock-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2271b1;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.chabok-instock-toggle:has(input:checked) {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.chabok-sort-select {
  padding: 0 32px 0 12px;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E")
    no-repeat right 8px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  min-width: 130px;
  box-sizing: border-box;
  line-height: 1.5;
  color: #334155;
}

.chabokmart-wrapper .chabok-empty-shop {
  text-align: center;
  padding: 80px 20px;
}

.chabokmart-wrapper .chabok-empty-icon {
  margin-bottom: 20px;
  opacity: 0.6;
}

.chabokmart-wrapper .chabok-empty-shop h3 {
  font-size: 20px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 8px;
}

.chabokmart-wrapper .chabok-empty-shop p {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 24px;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .chabokmart-wrapper *,
  .chabokmart-wrapper *::before,
  .chabokmart-wrapper *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .chabok-product-card:hover {
    transform: none;
  }

  .chabok-product-image img {
    transition: none;
  }

  .chabok-floating-notice,
  .chabok-mini-cart,
  .chabok-mini-cart-overlay {
    transition: none !important;
  }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .chabok-add-to-cart,
  .chabok-mini-cart,
  .chabok-mini-cart-toggle,
  .chabok-sticky-cart-bar,
  .chabok-floating-notice {
    display: none !important;
  }

  .chabok-product-card {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media screen and (max-width: 768px) {
  .chabok-products {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .chabok-single-product {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .chabok-single-actions {
    flex-direction: column;
  }

  .chabok-single-quantity {
    width: 100%;
    justify-content: center;
  }

  .chabok-single-add-to-cart {
    width: 100%;
  }

  .chabok-shop-title {
    font-size: 22px;
  }

  .chabok-cart-item {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
  }

  .chabok-cart-item-image {
    width: 56px;
    height: 56px;
  }

  .chabok-cart-item-subtotal {
    text-align: left;
    flex: 1;
  }

  .chabok-section-footer {
    flex-direction: column;
    padding: 12px 16px;
  }

  .chabok-unified-checkout {
    grid-template-columns: 1fr;
  }

  .chabok-unified-cart,
  .chabok-unified-form {
    padding: 16px;
  }

  .chabok-field-row {
    flex-direction: column;
    gap: 12px;
  }

  .chabok-checkout-submit {
    flex-direction: column;
    padding: 16px;
  }

  .chabok-checkout-button {
    width: 100%;
  }

  .chabok-shipping-method {
    padding: 12px 14px;
  }

  .chabok-mini-cart {
    width: 100vw;
    max-width: 100vw;
  }

  .chabok-sticky-cart-bar {
    display: flex;
  }

  body.chabokmart-shop .chabokmart-wrapper,
  body.chabokmart-cart .chabokmart-wrapper {
    padding-bottom: 80px;
  }
}
/* ==========================================================================
   Price Change Alert
   ========================================================================== */

.chabok-price-alert {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
}

.chabok-price-alert-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
}

.chabok-price-alert-header svg {
  color: #f59e0b;
  flex-shrink: 0;
}

.chabok-price-alert-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chabok-price-alert-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #78350f;
}

.chabok-price-alert-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.chabok-price-alert-increase .chabok-price-alert-icon {
  background: #fee2e2;
  color: #dc2626;
}

.chabok-price-alert-increase .chabok-price-alert-message {
  color: #991b1b;
}

.chabok-price-alert-decrease .chabok-price-alert-icon {
  background: #d1fae5;
  color: #059669;
}

.chabok-price-alert-decrease .chabok-price-alert-message {
  color: #065f46;
}

.chabok-price-alert-removed .chabok-price-alert-icon,
.chabok-price-alert-disabled .chabok-price-alert-icon {
  background: #fee2e2;
  color: #dc2626;
}

.chabok-price-alert-stock .chabok-price-alert-icon {
  background: #fef3c7;
  color: #d97706;
}

.chabok-price-alert-footer {
  padding: 10px 18px;
  background: #fef3c7;
  border-top: 1px solid #fcd34d;
  font-size: 12px;
  color: #92400e;
  margin: 0;
}
