/* ============================================================
   CART PAGE — Complete Shopping Cart
   Scoped under .cart-page — Modern, Clean, Interactive
============================================================ */

.cart-page {
  padding: 60px 0 80px;
  background: #f8fafc;
  min-height: 70vh;
}

.cart-page__title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
  position: relative;
  padding-bottom: 16px;
}

.cart-page__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: #2563eb;
  border-radius: 3px;
}

[dir="rtl"] .cart-page__title::after {
  left: auto;
  right: 0;
}

/* ============================================================
   EMPTY CART STATE
============================================================ */

.cart-page__empty {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
  max-width: 500px;
  margin: 40px auto;
  animation: fadeInUp 0.5s ease;
}

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

.cart-page__empty-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.cart-page__empty-icon svg {
  width: 50px;
  height: 50px;
  stroke: #64748b;
}

.cart-page__empty h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 12px;
}

.cart-page__empty p {
  font-size: 1.1rem;
  color: #64748b;
  margin-bottom: 32px;
}

.cart-page__empty .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 36px;
  height: 52px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.cart-page__empty .btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.cart-page__empty .btn:active {
  transform: translateY(0);
}

/* ============================================================
   CART LAYOUT
============================================================ */

.cart-page__layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

@media (max-width: 1024px) {
  .cart-page__layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* ============================================================
   CART ITEMS LIST
============================================================ */

.cart-page__items {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* Cart Row */
.cart-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  position: relative;
}

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

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

.cart-row.is-updating {
  opacity: 0.6;
  pointer-events: none;
}

.cart-row.is-updating::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 768px) {
  .cart-row {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }
}

/* Product Image */
.cart-row__image {
  width: 120px;
  height: 120px;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
  .cart-row__image {
    width: 100px;
    height: 100px;
    margin: 0 auto;
  }
}

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

.cart-row:hover .cart-row__image img {
  transform: scale(1.05);
}

/* Product Details */
.cart-row__details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-row__details h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0;
  line-height: 1.4;
}

.cart-row__price {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2563eb;
  margin: 0;
}

/* Quantity Controls */
.cart-row__qty {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  margin: 4px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.cart-row__qty button {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-row__qty button:hover {
  background: #f1f5f9;
  color: #2563eb;
}

.cart-row__qty button:active {
  background: #e2e8f0;
  transform: scale(0.95);
}

.cart-row__qty button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.cart-row__qty button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.cart-row__qty .qty-value {
  min-width: 44px;
  text-align: center;
  font-weight: 600;
  color: #0f172a;
  font-size: 1rem;
}

/* Remove Button */
.cart-remove {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  width: fit-content;
}

.cart-remove:hover {
  background: #fef2f2;
  color: #dc2626;
  transform: translateX(2px);
}

.cart-remove svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

[dir="rtl"] .cart-remove:hover {
  transform: translateX(-2px);
}

/* Row Total */
.cart-row__total {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  align-self: center;
  white-space: nowrap;
  padding: 0 8px;
}

@media (max-width: 768px) {
  .cart-row__total {
    text-align: right;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
    font-size: 1.1rem;
  }
  
  [dir="rtl"] .cart-row__total {
    text-align: left;
  }
}

/* ============================================================
   CART SUMMARY
============================================================ */

.cart-page__summary {
  position: sticky;
  top: 100px;
}

@media (max-width: 1024px) {
  .cart-page__summary {
    position: static;
  }
}

.summary-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 28px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

/* Shipping Progress */
.shipping-progress {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.shipping-progress p {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shipping-progress .success {
  color: #10b981;
  font-weight: 600;
}

.shipping-progress .success svg {
  width: 18px;
  height: 18px;
  stroke: #10b981;
}

.shipping-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.shipping-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 8px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.shipping-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Summary Divider */
.summary-card hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 20px 0;
}

/* Summary Rows */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 1rem;
  color: #475569;
}

.summary-row--total {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  border-top: 2px solid #e2e8f0;
  margin-top: 8px;
  padding-top: 20px;
}

/* Checkout Note */
.checkout-note {
  font-size: 0.8rem;
  color: #64748b;
  margin: 20px 0;
  padding: 16px;
  background: #f8fafc;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e2e8f0;
}

.checkout-note svg {
  width: 18px;
  height: 18px;
  stroke: #10b981;
  flex-shrink: 0;
}

/* Checkout Button */
.summary-card .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
  letter-spacing: 0.3px;
}

.summary-card .btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.summary-card .btn:active {
  transform: translateY(0);
}

.summary-card .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   CART NOTIFICATIONS
============================================================ */

.cart-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0f172a;
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 14px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s ease;
  border-left: 4px solid #2563eb;
  max-width: 360px;
  width: 100%;
}

.cart-notification.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cart-notification--success {
  border-left-color: #10b981;
}

.cart-notification--error {
  border-left-color: #ef4444;
}

.cart-notification svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

.cart-notification__message {
  flex: 1;
}

.cart-notification__close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.cart-notification__close:hover {
  color: #ffffff;
}

[dir="rtl"] .cart-notification {
  right: auto;
  left: 30px;
  border-left: none;
  border-right: 4px solid #2563eb;
}

/* ============================================================
   LOADING STATES
============================================================ */

.cart-skeleton {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  border: 1px solid #e2e8f0;
}

.cart-skeleton__row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid #e2e8f0;
}

.cart-skeleton__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-skeleton__image {
  width: 120px;
  height: 120px;
  background: #e2e8f0;
  border-radius: 16px;
  animation: pulse 1.5s ease infinite;
}

.cart-skeleton__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-skeleton__line {
  height: 20px;
  background: #e2e8f0;
  border-radius: 4px;
  animation: pulse 1.5s ease infinite;
}

.cart-skeleton__line:nth-child(1) { width: 60%; }
.cart-skeleton__line:nth-child(2) { width: 40%; }
.cart-skeleton__line:nth-child(3) { width: 30%; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================================
   RTL SUPPORT
============================================================ */

[dir="rtl"] .cart-row__details {
  text-align: right;
}

[dir="rtl"] .cart-remove {
  margin-right: 0;
  margin-left: auto;
}

[dir="rtl"] .cart-remove:hover {
  transform: translateX(-2px);
}

[dir="rtl"] .summary-row {
  flex-direction: row-reverse;
}

/* ============================================================
   RESPONSIVE DESIGN
============================================================ */

@media (max-width: 768px) {
  .cart-page {
    padding: 40px 0 60px;
  }
  
  .cart-page__title {
    font-size: 1.75rem;
    margin-bottom: 30px;
  }
  
  .cart-page__empty {
    padding: 40px 20px;
  }
  
  .cart-page__empty h2 {
    font-size: 1.5rem;
  }
  
  .cart-page__empty p {
    font-size: 1rem;
  }
  
  .summary-card {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .cart-page {
    padding: 30px 0 40px;
  }
  
  .cart-page__title {
    font-size: 1.5rem;
  }
  
  .cart-page__empty-icon {
    width: 80px;
    height: 80px;
  }
  
  .cart-page__empty-icon svg {
    width: 40px;
    height: 40px;
  }
  
  .cart-row__qty button {
    width: 40px;
    height: 40px;
  }
  
  .cart-row__qty .qty-value {
    min-width: 40px;
  }
  
  .checkout-note {
    flex-direction: column;
    text-align: center;
  }
  
  .cart-notification {
    left: 16px;
    right: 16px;
    bottom: 16px;
    width: auto;
  }
}
/* Cart Notification */
.cart-notification {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #0f172a;
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.3s ease;
  border-left: 4px solid #2563eb;
  max-width: 360px;
  width: auto;
}

.cart-notification.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.cart-notification--success {
  border-left-color: #10b981;
}

.cart-notification--error {
  border-left-color: #ef4444;
}

.cart-notification__message {
  flex: 1;
}

.cart-notification__close {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.cart-notification__close:hover {
  color: #ffffff;
}

/* Loading State */
.cart-row.is-updating {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.cart-row.is-updating::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Badge Update Animation */
.badge-update {
  animation: badgePop 0.3s ease;
}

@keyframes badgePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Shipping Progress Shimmer */
.shipping-fill.shimmer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* RTL Support */
[dir="rtl"] .cart-notification {
  right: auto;
  left: 30px;
  border-left: none;
  border-right: 4px solid #2563eb;
}

[dir="rtl"] .cart-row.is-updating::after {
  left: auto;
  right: 50%;
  transform: translate(50%, -50%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .cart-notification {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

/* Remove Animation */
.cart-row {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
/* ============================================================
   PRINT STYLES
============================================================ */

@media print {
  .cart-page {
    background: none;
    padding: 20px 0;
  }
  
  .cart-page__summary,
  .cart-remove,
  .cart-row__qty button {
    display: none;
  }
  
  .cart-row {
    border-bottom: 1px solid #000;
  }
  
  .cart-row__total {
    color: #000;
  }
}