/* ========================================================================
   CART PAGE STYLES - COMPLETE
   ======================================================================== */

.cart-page {
  padding: 40px 0 80px;
  min-height: 60vh;
  background: var(--bg);
}

/* Breadcrumb */
.cart-breadcrumb {
  margin-bottom: 30px;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.cart-breadcrumb a {
  color: var(--text-soft);
  text-decoration: none;
  transition: color 0.2s;
}

.cart-breadcrumb a:hover {
  color: var(--accent);
}

.cart-breadcrumb span {
  color: var(--text-dark);
  font-weight: 500;
}

/* Header */
.cart-header {
  margin-bottom: 40px;
}

.cart-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--text-dark);
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, var(--text-dark) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-subtitle {
  color: var(--text-soft);
  font-size: 1rem;
}

/* Cart Grid Layout */
.cart-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 30px;
}

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

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

/* Cart Items Section */
.cart-items-section {
  background: white;
  border-radius: 24px;
  padding: 25px;
  box-shadow: 0 8px 30px -10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-light);
}

.cart-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-light);
}

.cart-items-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.cart-items-header h2 span {
  color: var(--accent);
  margin-left: 5px;
}

#clearCartBtn {
  color: var(--text-soft);
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 30px;
  background: var(--bg);
  transition: all 0.2s;
}

#clearCartBtn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Cart Items List */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 5px;
}

.cart-items-list::-webkit-scrollbar {
  width: 4px;
}

.cart-items-list::-webkit-scrollbar-track {
  background: var(--bg);
  border-radius: 4px;
}

.cart-items-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

/* Cart Item Card */
.cart-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--bg);
  border-radius: 16px;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
  position: relative;
}

.cart-item:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--accent-light);
}

.cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: white;
  border: 1px solid var(--border-light);
}

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

.cart-item:hover .cart-item-image img {
  transform: scale(1.05);
}

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

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

.cart-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.cart-item-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.cart-item-provider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 0.8rem;
}

.cart-item-provider i {
  color: var(--accent);
  font-size: 0.7rem;
}

.cart-item-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Quantity Control */
.quantity-control-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 40px;
  padding: 4px;
}

.quantity-btn-compact {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.quantity-btn-compact:hover:not(:disabled) {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.quantity-btn-compact:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.quantity-value-compact {
  font-weight: 600;
  color: var(--text-dark);
  min-width: 30px;
  text-align: center;
}

.stock-indicator {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.stock-indicator.in-stock {
  background: #e3f2e9;
  color: #2f6e4a;
}

.stock-indicator.low-stock {
  background: #fef3e2;
  color: #b45309;
}

.stock-indicator i {
  font-size: 0.65rem;
}

.cart-item-total {
  margin-left: auto;
  text-align: right;
}

.total-label {
  font-size: 0.65rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: block;
  margin-bottom: 2px;
}

.total-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.cart-item-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0;
}

.cart-item:hover .cart-item-remove {
  opacity: 1;
}

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

/* Cart Actions */
.cart-actions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.cart-actions .btn-outline {
  padding: 12px 20px;
  font-size: 0.9rem;
}

/* Order Summary Card */
.summary-card {
  background: white;
  border-radius: 24px;
  padding: 25px;
  box-shadow: 0 8px 30px -10px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.summary-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-light);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.summary-row.total {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid var(--border-light);
  font-weight: 600;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.summary-value {
  font-weight: 500;
  color: var(--text-dark);
}

.summary-value.total-amount {
  font-size: 1.3rem;
  color: var(--accent);
  font-weight: 700;
}

/* Stock Warning */
.stock-warning {
  background: #fef3e2;
  border-radius: 12px;
  padding: 12px 15px;
  margin: 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b45309;
  font-size: 0.85rem;
  border: 1px solid #fde6c9;
}

.stock-warning i {
  font-size: 1rem;
}

.stock-warning span {
  flex: 1;
}

/* Checkout Button */
.btn-block {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  margin-bottom: 15px;
}

.secure-checkout-note {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.secure-checkout-note i {
  color: var(--accent);
}

/* Payment Methods Card */
.payment-methods-card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border-light);
}

.payment-methods-card h4 {
  font-size: 0.9rem;
  color: var(--text-dark);
  margin: 0 0 15px 0;
}

.payment-icons {
  display: flex;
  gap: 15px;
  color: #94a3b8;
  font-size: 2rem;
}

.payment-icons i {
  transition: color 0.2s;
}

.payment-icons i:hover {
  color: var(--accent);
}

/* Empty Cart */
.cart-empty {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 30px;
  box-shadow: 0 8px 30px -10px rgba(0, 0, 0, 0.05);
}

.empty-illustration {
  width: 120px;
  height: 120px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 25px;
}

.empty-illustration i {
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
}

.cart-empty h2 {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.cart-empty p {
  color: var(--text-soft);
  margin-bottom: 30px;
}

/* Loading State */
.cart-loading {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 30px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

/* Error State */
.cart-error {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 30px;
}

.cart-error i {
  font-size: 3rem;
  color: #ef4444;
  margin-bottom: 15px;
}

.cart-error h3 {
  font-size: 1.2rem;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.cart-error p {
  color: var(--text-soft);
  margin-bottom: 20px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-soft);
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text-dark);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Out of Stock Modal */
.stock-modal-icon {
  width: 60px;
  height: 60px;
  background: #fef3e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.stock-modal-icon i {
  font-size: 2rem;
  color: #b45309;
}

.stock-modal-item {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stock-modal-item .item-name {
  font-weight: 600;
  color: var(--text-dark);
}

.stock-modal-item .item-stock {
  color: #b45309;
  font-weight: 500;
  font-size: 0.85rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 3000;
}

.toast-notification {
  padding: 12px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  animation: slideInRight 0.3s ease;
  border-left: 4px solid;
}

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

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

.toast-notification.info {
  border-left-color: var(--accent);
}

.toast-notification i {
  font-size: 1.1rem;
}

.toast-notification.success i {
  color: #10b981;
}

.toast-notification.error i {
  color: #ef4444;
}

.toast-notification.info i {
  color: var(--accent);
}

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

/* Responsive */
@media (max-width: 768px) {
  .cart-page {
    padding: 20px 0 60px;
  }

  .cart-title {
    font-size: 1.8rem;
  }

  .cart-item {
    flex-direction: column;
    padding: 15px;
  }

  .cart-item-image {
    width: 100%;
    height: 150px;
  }

  .cart-item-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .cart-item-title {
    max-width: 100%;
  }

  .cart-item-price {
    font-size: 1rem;
  }

  .cart-item-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .cart-item-total {
    margin-left: 0;
    text-align: left;
  }

  .cart-item-remove {
    opacity: 1;
  }

  .payment-icons {
    flex-wrap: wrap;
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .cart-title {
    font-size: 1.5rem;
  }

  .cart-items-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .cart-actions .btn-outline {
    width: 100%;
    justify-content: center;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer button {
    width: 100%;
  }
}
/* Cart Dropdown Styles */
.cart-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  z-index: 1000;
  display: none;
  margin-top: 10px;
}

.cart-dropdown.active {
  display: block;
  animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-dropdown-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-dropdown-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-dark);
}

.cart-item-count {
  font-size: 0.75rem;
  color: var(--text-soft);
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 30px;
}

.cart-dropdown-items {
  max-height: 320px;
  overflow-y: auto;
}

.cart-dropdown-item {
  display: flex;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.cart-dropdown-item:hover {
  background: var(--bg);
}

.cart-item-image {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
}

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

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

.cart-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-meta {
  display: flex;
  gap: 12px;
  font-size: 0.7rem;
  color: var(--text-soft);
}

.cart-item-quantity {
  font-weight: 500;
}

.cart-item-price {
  font-weight: 600;
  color: var(--accent);
}

.cart-item-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

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

.cart-dropdown-more {
  padding: 12px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.cart-dropdown-more a {
  color: var(--accent);
  font-size: 0.8rem;
  text-decoration: none;
}

.cart-dropdown-footer {
  padding: 16px 20px;
}

.cart-dropdown-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.cart-total-amount {
  font-size: 1.1rem;
  color: var(--accent);
}

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

.cart-dropdown-actions .btn-outline,
.cart-dropdown-actions .btn-primary {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: 0.85rem;
  border-radius: 40px;
}

.cart-dropdown-empty {
  text-align: center;
  padding: 40px 20px;
}

.cart-dropdown-empty i {
  font-size: 2.5rem;
  color: var(--text-soft);
  margin-bottom: 12px;
  opacity: 0.5;
}

.cart-dropdown-empty p {
  color: var(--text-soft);
  margin-bottom: 16px;
}

.cart-dropdown-loading {
  text-align: center;
  padding: 40px 20px;
}

.cart-dropdown-loading .loading-spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 12px;
}

.cart-dropdown-error {
  text-align: center;
  padding: 30px 20px;
}

.cart-dropdown-error i {
  font-size: 2rem;
  color: #ef4444;
  margin-bottom: 12px;
}

.cart-dropdown-error p {
  color: var(--text-soft);
  margin-bottom: 16px;
}
