/* ═══════════════════════════════════════════
   Cart System Styles — ParaShop Tahiri
   ═══════════════════════════════════════════ */

/* ── Mini Cart ── */
.pst-mini-cart-wrapper { position: relative; display: flex; align-items: center; gap: 4px; }
.pst-cart-btn, .pst-wishlist-header-btn { position: relative; background: none; border: none; cursor: pointer; color: var(--text-primary); display: flex; align-items: center; justify-content: center; transition: color .2s; }
.pst-cart-btn:hover, .pst-wishlist-header-btn:hover { color: var(--cta-text); background: var(--accent-lime); }
.pst-cart-count, .pst-wishlist-count { position: absolute; top: 0; right: 0; background: #c0392b; color: #fff; font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; }
.pst-cart-count.bounce { animation: pst-bounce .3s ease; }
@keyframes pst-bounce { 0%,100% { transform: scale(1); } 50% { transform: scale(1.4); } }
.pst-mini-cart { display: none; position: absolute; top: 100%; right: 0; width: 380px; max-height: 540px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.15); z-index: 10000; overflow: hidden; }
.pst-mini-cart.open { display: block; }
.pst-mini-cart-header { padding: 14px 16px; border-bottom: 1px solid #eee; font-size: 15px; }
.pst-mini-cart-items { max-height: 320px; overflow-y: auto; padding: 8px; }
.pst-mini-cart-item { display: flex; gap: 12px; padding: 10px 8px; border-bottom: 1px solid #f5f5f5; align-items: center; }
.pst-mini-cart-item img { width: 60px; height: 60px; object-fit: contain; border-radius: 4px; background: #fafafa; }
.pst-mini-cart-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pst-mini-cart-item-name { font-size: 13px; font-weight: 600; color: #333; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pst-mini-cart-item-name:hover { color: #006341; }
.pst-mini-cart-item-variant { font-size: 11px; color: #888; }
.pst-mini-cart-item-qty { font-size: 11px; color: #666; }
.pst-mini-cart-item-price { font-size: 13px; font-weight: 700; color: #006341; }
.pst-mini-cart-remove { background: none; border: none; cursor: pointer; font-size: 20px; color: #ccc; padding: 4px; line-height: 1; }
.pst-mini-cart-remove:hover { color: #c0392b; }
.pst-mini-cart-more { padding: 8px 16px; text-align: center; font-size: 12px; color: #888; }
.pst-mini-cart-summary { border-top: 1px solid #eee; padding: 12px 16px; }
.pst-mini-cart-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; }
.pst-mini-cart-total strong { font-size: 16px; color: #006341; }
.pst-mini-cart-actions { display: flex; flex-direction: column; gap: 8px; }
.pst-mini-cart-empty { text-align: center; padding: 40px 20px; }
.pst-mini-cart-empty svg { margin-bottom: 12px; }
.pst-mini-cart-empty p { color: #888; margin-bottom: 16px; font-size: 14px; }

/* ── Free Shipping Bar ── */
.pst-free-shipping-bar { background: #e8f5e9; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 12px; color: #2e7d32; position: relative; overflow: hidden; }
.pst-free-shipping-fill { position: absolute; top: 0; left: 0; height: 100%; background: rgba(46,125,50,.12); border-radius: 6px; transition: width .4s ease; }
.pst-free-shipping-bar span { position: relative; z-index: 1; }
.pst-free-shipping-bar-lg { padding: 10px 16px; font-size: 13px; }

/* ── Full Cart Page ── */
.pst-cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; max-width: 1200px; margin: 0 auto; padding: 24px 16px; }
.pst-cart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.pst-cart-header h1 { font-size: 24px; margin: 0; }
.pst-cart-item-count { font-size: 14px; color: #888; }
.pst-cart-empty { text-align: center; padding: 80px 20px; grid-column: 1 / -1; }
.pst-cart-empty p { font-size: 16px; color: #888; margin-bottom: 20px; }
.pst-cart-table-wrap { overflow-x: auto; }
.pst-cart-table { width: 100%; border-collapse: collapse; }
.pst-cart-table thead th { text-align: left; padding: 12px 8px; font-size: 12px; text-transform: uppercase; color: #888; border-bottom: 2px solid #eee; font-weight: 600; }
.pst-cart-table tbody td { padding: 16px 8px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.pst-col-product { min-width: 280px; }
.pst-col-price, .pst-col-total { min-width: 100px; }
.pst-col-qty { min-width: 130px; }
.pst-col-actions { min-width: 80px; }
.pst-cart-product { display: flex; gap: 14px; align-items: center; }
.pst-cart-product img { width: 80px; height: 80px; object-fit: contain; border-radius: 4px; background: #fafafa; }
.pst-cart-product-info { display: flex; flex-direction: column; gap: 2px; }
.pst-cart-product-name { font-weight: 600; color: #333; text-decoration: none; font-size: 14px; }
.pst-cart-product-name:hover { color: #006341; }
.pst-cart-product-brand { font-size: 12px; color: #888; }
.pst-cart-product-variant { font-size: 12px; color: #666; }
.pst-cart-product-discount { display: inline-block; background: #e8f5e9; color: #2e7d32; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; margin-top: 4px; width: fit-content; }
.pst-cart-unit-price { font-size: 14px; color: #666; }
.pst-cart-line-total { font-size: 15px; font-weight: 700; color: #006341; }
.pst-cart-item-remove-mobile { display: none; background: none; border: none; font-size: 20px; color: #ccc; cursor: pointer; padding: 4px; }
.pst-qty-control { display: flex; align-items: center; gap: 0; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; width: fit-content; }
.pst-qty-btn { width: 36px; height: 36px; border: none; background: #f5f5f5; cursor: pointer; font-size: 16px; font-weight: 700; color: #333; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.pst-qty-btn:hover { background: #e0e0e0; }
.pst-qty-input { width: 48px; height: 36px; text-align: center; border: none; border-left: 1px solid #ddd; border-right: 1px solid #ddd; font-size: 14px; font-weight: 600; -moz-appearance: textfield; }
.pst-qty-input::-webkit-inner-spin-button, .pst-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pst-cart-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pst-btn-icon { width: 36px; height: 36px; border: 1px solid #e0e0e0; border-radius: 6px; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #888; transition: all .2s; }
.pst-btn-icon:hover { border-color: #006341; color: #006341; }
.pst-btn-icon-danger:hover { border-color: #c0392b; color: #c0392b; }

/* ── Cart Sidebar ── */
.pst-cart-sidebar { position: sticky; top: 90px; align-self: start; }
.pst-cart-summary { background: #f9f9f9; border-radius: 8px; padding: 20px; }
.pst-cart-summary h3 { margin: 0 0 16px; font-size: 18px; }
.pst-summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: #555; }
.pst-summary-discount { color: #2e7d32; }
.pst-summary-total { display: flex; justify-content: space-between; padding: 12px 0; border-top: 2px solid #ddd; margin-top: 8px; font-size: 16px; }
.pst-summary-total strong { font-size: 20px; color: #006341; }
.pst-cart-summary .pst-btn { margin-bottom: 8px; }
.pst-coupon-form { margin: 20px 0; }
.pst-coupon-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.pst-coupon-input-group { display: flex; gap: 8px; }
.pst-coupon-input-group input { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; }
.pst-coupon-msg { margin-top: 8px; font-size: 12px; padding: 6px 10px; border-radius: 4px; }
.pst-coupon-success { background: #e8f5e9; color: #2e7d32; }
.pst-coupon-error { background: #ffebee; color: #c62828; }
.pst-gift-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin-top: 12px; }
.pst-gift-wrap input { width: 18px; height: 18px; accent-color: #006341; }

/* ── Saved for Later ── */
.pst-cart-saved { margin-top: 32px; padding-top: 24px; border-top: 2px solid #eee; }
.pst-cart-saved h3 { font-size: 16px; margin: 0 0 12px; color: #666; }
.pst-cart-saved-items { display: flex; gap: 12px; flex-wrap: wrap; }
.pst-cart-saved-item { display: flex; align-items: center; gap: 12px; background: #fafafa; border-radius: 8px; padding: 10px 14px; width: calc(50% - 6px); box-sizing: border-box; }
.pst-cart-saved-item img { width: 48px; height: 48px; object-fit: contain; }
.pst-cart-saved-info { flex: 1; min-width: 0; }
.pst-cart-saved-info a { font-size: 13px; font-weight: 600; color: #333; text-decoration: none; display: block; }
.pst-cart-saved-info span { font-size: 12px; color: #006341; }

/* ── Drawers ── */
.pst-drawer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.5); z-index: 50000; opacity: 0; visibility: hidden; transition: all .3s; }
.pst-drawer-overlay.open { opacity: 1; visibility: visible; }
.pst-drawer { position: fixed; top: 0; right: 0; width: 400px; max-width: 90vw; height: 100%; background: #fff; box-shadow: -4px 0 24px rgba(0,0,0,.1); transform: translateX(100%); transition: transform .3s ease; overflow-y: auto; }
.pst-drawer-overlay.open .pst-drawer { transform: translateX(0); }
.pst-drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eee; }
.pst-drawer-header h3 { margin: 0; font-size: 18px; }
.pst-drawer-close { background: none; border: none; font-size: 28px; cursor: pointer; color: #888; line-height: 1; padding: 4px; }
.pst-drawer-close:hover { color: #333; }
.pst-drawer-body { padding: 20px; }

/* ── Wishlist Drawer ── */
.pst-wishlist-empty { text-align: center; padding: 40px 0; color: #888; font-size: 14px; }
.pst-wishlist-empty svg { margin-bottom: 12px; }
.pst-wishlist-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.pst-wishlist-item img { width: 56px; height: 56px; object-fit: contain; border-radius: 4px; background: #fafafa; }
.pst-wishlist-item-info { flex: 1; min-width: 0; }
.pst-wishlist-item-name { font-size: 13px; font-weight: 600; color: #333; text-decoration: none; display: block; }
.pst-wishlist-item-price { font-size: 12px; color: #006341; font-weight: 600; }
.pst-wishlist-item .pst-btn-sm { white-space: nowrap; }
.pst-wishlist-remove { background: none; border: none; cursor: pointer; font-size: 18px; color: #ccc; padding: 4px; }
.pst-wishlist-remove:hover { color: #c0392b; }

/* ── Toasts ── */
.pst-toast-container { position: fixed; top: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.pst-toast { display: flex; align-items: center; gap: 10px; background: #333; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.2); transform: translateX(120%); opacity: 0; transition: all .3s ease; pointer-events: auto; min-width: 260px; max-width: 420px; }
.pst-toast.show { transform: translateX(0); opacity: 1; }
.pst-toast.hiding { transform: translateX(120%); opacity: 0; }
.pst-toast-success { background: #2e7d32; }
.pst-toast-error { background: #c62828; }
.pst-toast-info { background: #1565c0; }
.pst-toast-warning { background: #ef6c00; }
.pst-toast-icon { font-size: 18px; flex-shrink: 0; }
.pst-toast-msg { flex: 1; }

/* ── Bestsellers Swiper Smooth Click ── */
.product-swiper { padding: 20px 0 40px; min-height: 400px; overflow: visible; }
.product-swiper .swiper-wrapper { align-items: stretch; }
.product-swiper .swiper-slide { transition: all 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94); cursor: pointer; width: 300px; height: auto; }
.product-swiper .swiper-slide .product-card { height: 100%; }
.product-swiper .swiper-slide .product-card { cursor: pointer; }
.product-swiper .swiper-slide .product-card:hover { transform: none; box-shadow: none; }
.product-swiper .swiper-slide.swiper-slide-active .product-card { cursor: default; }
.product-swiper .swiper-slide .product-card-add,
.product-swiper .swiper-slide .product-card-view { cursor: pointer; position: relative; z-index: 5; }
.product-swiper .swiper-slide .product-card-wishlist { cursor: pointer; z-index: 5; }
.product-swiper .swiper-slide .product-card-add:hover { opacity: 0.85; }
.product-swiper .swiper-slide .product-card-view:hover { background: var(--accent-lime); color: var(--cta-text); }
.product-swiper .swiper-slide .product-card-name { pointer-events: none; }
.product-swiper .swiper-slide .product-card-image img { pointer-events: none; }

/* ── Buttons (shared) ── */
.pst-btn { display: inline-block; padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: 6px; border: 2px solid transparent; cursor: pointer; text-decoration: none; transition: all .2s; text-align: center; }
.pst-btn-primary { background: #006341; color: #fff; border-color: #006341; }
.pst-btn-primary:hover { background: #004d33; border-color: #004d33; color: #fff; }
.pst-btn-outline { background: transparent; color: #006341; border-color: #006341; }
.pst-btn-outline:hover { background: #006341; color: #fff; }
.pst-btn-block { display: block; width: 100%; }
.pst-btn-lg { padding: 14px 24px; font-size: 16px; }
.pst-btn-sm { padding: 6px 12px; font-size: 12px; }
.pst-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Checkout ── */
.pst-checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.pst-checkout-empty { grid-column: 1 / -1; text-align: center; padding: 80px 20px; }
.pst-checkout-empty h2 { margin-bottom: 12px; }
.pst-checkout-desc { color: #888; font-size: 14px; margin-bottom: 20px; }
.pst-checkout-steps { display: flex; gap: 4px; margin-bottom: 32px; }
.pst-step { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #f5f5f5; border-radius: 6px; font-size: 13px; color: #999; flex: 1; }
.pst-step.active { background: #006341; color: #fff; font-weight: 600; }
.pst-step.completed { background: #e8f5e9; color: #2e7d32; }
.pst-step-num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.1); font-size: 12px; font-weight: 700; }
.pst-step.active .pst-step-num { background: rgba(255,255,255,.2); }
.pst-step.completed .pst-step-num { background: #2e7d32; color: #fff; }
.pst-checkout-nav { display: flex; gap: 12px; justify-content: space-between; margin-top: 32px; }
.pst-form-group { margin-bottom: 16px; }
.pst-form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #444; }
.pst-form-group input, .pst-form-group textarea, .pst-form-group select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; font-family: inherit; box-sizing: border-box; transition: border-color .2s; }
.pst-form-group input:focus, .pst-form-group textarea:focus { border-color: #006341; outline: none; }
.pst-form-group input.error { border-color: #c62828; background: #fff5f5; }
.pst-checkout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Shipping Options ── */
.pst-shipping-options { margin: 16px 0; }
.pst-shipping-option { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px 16px; align-items: center; padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: all .2s; }
.pst-shipping-option:hover { border-color: #006341; }
.pst-shipping-option input[type="radio"]:checked + .pst-shipping-opt-name + .pst-shipping-opt-carrier + .pst-shipping-opt-price + .pst-shipping-opt-delay,
.pst-shipping-option:has(input:checked) { border-color: #006341; background: #f0faf5; }
.pst-shipping-option input { display: none; }
.pst-shipping-option input:checked ~ * { color: #006341; }
.pst-shipping-opt-name { font-weight: 600; font-size: 14px; grid-column: 2; }
.pst-shipping-opt-carrier { font-size: 12px; color: #888; grid-column: 2; }
.pst-shipping-opt-price { font-weight: 700; font-size: 14px; grid-column: 3; color: #006341; }
.pst-shipping-opt-delay { font-size: 12px; color: #888; grid-column: 4; }
.pst-shipping-free { background: #f0faf5; }

/* ── Payment Methods ── */
.pst-payment-methods { display: grid; gap: 10px; margin: 16px 0; }
.pst-payment-method { display: grid; grid-template-columns: auto auto 1fr; gap: 8px 16px; align-items: center; padding: 14px 16px; border: 2px solid #e0e0e0; border-radius: 8px; cursor: pointer; transition: all .2s; }
.pst-payment-method.active, .pst-payment-method:hover { border-color: #006341; background: #f0faf5; }
.pst-payment-method input { display: none; }
.pst-payment-method input:checked ~ * { color: #006341; }
.pst-payment-icon { font-size: 24px; grid-column: 1; }
.pst-payment-name { font-weight: 600; font-size: 14px; grid-column: 2; }
.pst-payment-desc { font-size: 12px; color: #666; grid-column: 3; }

/* ── Review Step ── */
.pst-review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.pst-review-block { background: #f9f9f9; border-radius: 8px; padding: 16px; }
.pst-review-block h3 { margin: 0 0 10px; font-size: 14px; color: #006341; border-bottom: 1px solid #e0e0e0; padding-bottom: 8px; }
.pst-review-block p { margin: 4px 0; font-size: 13px; color: #444; }
.pst-review-items { margin-bottom: 16px; }
.pst-review-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.pst-review-item img { width: 48px; height: 48px; object-fit: contain; }
.pst-review-item div { flex: 1; display: flex; flex-direction: column; }
.pst-review-item-name { font-size: 13px; font-weight: 600; }
.pst-review-item-qty { font-size: 12px; color: #888; }
.pst-review-item > span:last-child { font-weight: 700; font-size: 14px; color: #006341; }

/* ── Checkout Summary ── */
.pst-checkout-summary { background: #f9f9f9; border-radius: 8px; padding: 20px; position: sticky; top: 90px; }
.pst-checkout-summary h3 { margin: 0 0 16px; font-size: 16px; }
.pst-summary-items { max-height: 280px; overflow-y: auto; margin-bottom: 16px; }
.pst-summary-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.pst-summary-item img { width: 36px; height: 36px; object-fit: contain; }
.pst-summary-item-name { flex: 1; font-size: 12px; }
.pst-summary-item-qty { font-size: 11px; color: #888; }
.pst-summary-totals { border-top: 1px solid #ddd; padding-top: 12px; }
.pst-alert { padding: 12px 16px; border-radius: 6px; font-size: 14px; margin-bottom: 20px; }
.pst-alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

/* ── Confirmation Page ── */
.pst-confirmation { max-width: 720px; margin: 40px auto; padding: 0 16px; text-align: center; }
.pst-confirmation-icon { font-size: 64px; margin-bottom: 16px; }
.pst-confirmation h1 { font-size: 28px; margin: 0 0 8px; }
.pst-confirmation p { font-size: 15px; color: #666; margin: 4px 0; }
.pst-order-number { background: #f5f5f5; border-radius: 8px; padding: 16px; margin: 24px 0; }
.pst-order-number span { font-size: 12px; color: #888; display: block; margin-bottom: 4px; }
.pst-order-number strong { font-size: 20px; color: #006341; letter-spacing: 1px; }
.pst-confirmation-details { text-align: left; background: #f9f9f9; border-radius: 8px; padding: 24px; margin: 24px 0; }
.pst-confirmation-details h3 { margin: 0 0 16px; font-size: 16px; }
.pst-confirmation-details .pst-summary-row { font-size: 14px; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .pst-mini-cart { width: 340px; right: -10px; }
  .pst-cart-layout { grid-template-columns: 1fr; }
  .pst-cart-sidebar { position: static; }
  .pst-checkout-layout { grid-template-columns: 1fr; }
  .pst-checkout-grid { grid-template-columns: 1fr; }
  .pst-review-grid { grid-template-columns: 1fr; }
  .pst-cart-table thead { display: none; }
  .pst-cart-table tbody tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 8px; border-bottom: 1px solid #f0f0f0; }
  .pst-cart-table tbody td { border: none; padding: 4px 0; }
  .pst-col-product { grid-column: 1 / -1; }
  .pst-col-price, .pst-col-qty, .pst-col-total, .pst-col-actions { display: flex; align-items: center; gap: 8px; }
  .pst-col-price:before { content: 'Prix: '; font-size: 12px; color: #888; }
  .pst-col-qty:before { content: 'Qté: '; font-size: 12px; color: #888; }
  .pst-col-total:before { content: 'Total: '; font-size: 12px; color: #888; }
  .pst-cart-item-remove-mobile { display: inline-block; }
  .pst-cart-saved-item { width: 100%; }
  .pst-drawer { width: 100%; max-width: 100vw; }
}

@media (max-width: 480px) {
  .pst-mini-cart { width: calc(100vw - 16px); right: -8px; }
  .pst-cart-header h1 { font-size: 20px; }
}
