/* ===== Modern Cart Page Styles ===== */

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-orange);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* ===== Main Layout ===== */
#main-content {
  min-height: 100vh;
}

.cart-main {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 2rem 0;
}

.cart-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Cart Header ===== */
.cart-header {
  text-align: center;
  margin-bottom: 3rem;
}

.cart-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cart-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ===== Cart Content Layout ===== */
.cart-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .cart-content {
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
  }
}

/* ===== Cart Items Section ===== */
.cart-items-section {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.cart-items {
  padding: 0;
}

/* ===== Individual Cart Item ===== */
.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  padding: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  position: relative;
}

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

.cart-item:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ===== Cart Item Image ===== */
.cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.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 ===== */
.cart-item-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.cart-item-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.cart-item-category {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.cart-item-price {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-orange);
  margin: 0;
}

/* ===== Cart Item Controls ===== */
.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1rem;
  justify-content: center;
}

/* ===== Quantity Selector ===== */
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quantity-btn {
  width: 40px;
  height: 40px;
  background: #f8fafc;
  border: none;
  font-size: 1.125rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  background: var(--primary-orange);
  color: white;
  transform: scale(1.05);
}

.quantity-btn:active {
  transform: scale(0.95);
}

.quantity-value {
  width: 60px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--text-primary);
  background: white;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

/* ===== Cart Item Total ===== */
.cart-item-total {
  text-align: right;
}

.total-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 0.5rem;
}

/* ===== Remove Button ===== */
.cart-item-remove {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.cart-item-remove:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.cart-item-remove:active {
  transform: translateY(0);
}

/* ===== Empty Cart ===== */
.empty-cart {
  padding: 4rem 2rem;
  text-align: center;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.empty-cart-content {
  max-width: 400px;
  margin: 0 auto;
}

.empty-cart-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.empty-cart h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.empty-cart p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* ===== Cart Summary ===== */
.cart-summary-section {
  position: sticky;
  top: 2rem;
  height: fit-content;
}

.cart-summary {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.summary-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 1.5rem;
  margin: 0;
  background: linear-gradient(135deg, var(--neutral-light), var(--neutral-medium));
  border-bottom: 1px solid #e2e8f0;
}

.summary-details {
  padding: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.summary-label {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.summary-row.total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-orange);
  padding: 1rem 0;
  margin-top: 0.5rem;
  border-top: 2px solid var(--primary-orange);
  border-bottom: none;
}

.summary-actions {
  padding: 1.5rem;
  background: var(--neutral-light);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-actions .btn {
  width: 100%;
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
  display: inline-block;
}

.summary-actions .btn-primary {
  background: linear-gradient(135deg, var(--primary-orange), var(--primary-orange-light));
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
}

.summary-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 126, 34, 0.4);
}

.summary-actions .btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.summary-actions .btn-outline {
  background: white;
  color: var(--primary-orange);
  border: 2px solid var(--primary-orange);
}

.summary-actions .btn-outline:hover {
  background: var(--primary-orange);
  color: white;
  transform: translateY(-1px);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .cart-main {
    padding: 1rem 0;
  }
  
  .cart-container {
    padding: 0 0.5rem;
  }
  
  .cart-title {
    font-size: 2rem;
  }
  
  .cart-item {
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  
  .cart-item-controls {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
  }
  
  .cart-item-image {
    width: 80px;
    height: 80px;
  }
  
  .cart-item-name {
    font-size: 1.125rem;
  }
  
  .summary-actions {
    padding: 1rem;
  }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-item {
  animation: fadeInUp 0.6s ease-out;
}

.cart-item:nth-child(1) { animation-delay: 0.1s; }
.cart-item:nth-child(2) { animation-delay: 0.2s; }
.cart-item:nth-child(3) { animation-delay: 0.3s; }
.cart-item:nth-child(4) { animation-delay: 0.4s; }

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

.cart-item.removing {
  animation: slideOut 0.3s ease-in-out forwards;
}

@keyframes quantityUpdate {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.quantity-value.updating {
  animation: quantityUpdate 0.3s ease-in-out;
}

/* ===== Loading States ===== */
.cart-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem;
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.cart-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.cart-loading p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 1rem;
}