/* Cart Page Specific Styles */

/* Light mode (default) */
body {
  color: #212529;
}

/* Product thumbnail styles */
.product-thumb img {
  max-width: 100px;
  max-height: 100px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  body {
    color: #e0e0e0;
  }
  
  .cart-items-box,
  .cart-summary-box {
    background-color: #1e1e1e;
    color: #e0e0e0;
  }
  
  .table thead th {
    color: #e0e0e0;
    border-color: #444;
  }
  
  .table tbody tr {
    border-color: #444 !important;
  }
  
  .btn-outline {
    color: #e0e0e0;
    border-color: #666;
  }
  
  .btn-outline:hover {
    background-color: #333;
    border-color: #999;
  }
  
  .form-control {
    background-color: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
  }
  
  .breadcrumb-item a {
    color: #8197a4;
  }
  
  .breadcrumb-item.active {
    color: #aaa;
  }
  
  a {
    color: #8197a4;
  }
  
  a:hover {
    color: #a3b1bc;
  }
  
  .text-muted {
    color: #aaa !important;
  }
  
  .divider {
    background-color: #444;
  }
  
  .remove-btn {
    color: #f44336;
  }
  
  .remove-btn:hover {
    color: #ff5252;
  }
}

/* Responsive font sizing */
/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  body {
    font-size: 16px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  h4 {
    font-size: 1.4rem;
  }
  
  .mb-30 {
    margin-bottom: 30px !important;
  }
  
  .mb-20 {
    margin-bottom: 20px !important;
  }
}

/* Medium devices (tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .product-thumb img {
    max-width: 80px;
    max-height: 80px;
  }
  
  body {
    font-size: 15px;
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  h4 {
    font-size: 1.3rem;
  }
  
  .mb-30 {
    margin-bottom: 25px !important;
  }
  
  .mb-20 {
    margin-bottom: 15px !important;
  }
  
  .product-info h5 {
    font-size: 1rem;
  }
}

/* Small devices (landscape phones, 576px to 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
  .product-thumb img {
    max-width: 70px;
    max-height: 70px;
  }
  
  body {
    font-size: 14px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h4 {
    font-size: 1.2rem;
  }
  
  .mb-30 {
    margin-bottom: 20px !important;
  }
  
  .mb-20 {
    margin-bottom: 10px !important;
  }
  
  .product-info h5 {
    font-size: 0.95rem;
  }
  
  .table thead th {
    font-size: 0.9rem;
  }
  
  .btn {
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
  }
  
  .quantity-input .quantity-down,
  .quantity-input .quantity-up {
    font-size: 1rem;
    width: 30px;
    height: 30px;
  }
  
  .quantity-input .qty-input {
    width: 50px !important;
    font-size: 0.9rem;
  }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
  .product-thumb img {
    max-width: 60px;
    max-height: 60px;
  }
  
  body {
    font-size: 13px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  h4 {
    font-size: 1.1rem;
  }
  
  .mb-30 {
    margin-bottom: 15px !important;
  }
  
  .mb-20 {
    margin-bottom: 8px !important;
  }
  
  .product-info h5 {
    font-size: 0.9rem;
  }
  
  .table thead th {
    font-size: 0.85rem;
  }
  
  .btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
  }
  
  .quantity-input .quantity-down,
  .quantity-input .quantity-up {
    font-size: 0.9rem;
    width: 25px;
    height: 25px;
  }
  
  .quantity-input .qty-input {
    width: 45px !important;
    font-size: 0.85rem;
  }
  
  /* Hide product thumbnails on very small screens */
  .product-thumb {
    display: none;
  }
  
  /* Stack action buttons on small screens */
  .cart-action-buttons {
    flex-direction: column !important;
    gap: 10px !important;
  }
  
  .cart-action-buttons .btn-simple,
  .cart-action-buttons .btn-outline {
    width: 100%;
    text-align: center;
  }
  
  /* Adjust summary box padding */
  .cart-summary-box {
    padding: 15px !important;
  }
  
  .cart-items-box {
    padding: 15px !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  body {
    background-color: #ffffff;
    color: #000000;
  }
  
  a {
    color: #0000ee;
  }
  
  a:hover {
    color: #0000aa;
  }
  
  .btn-theme {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
  }
  
  .btn-outline {
    color: #000000;
    border-color: #000000;
  }
  
  .btn-outline:hover {
    background-color: #000000;
    border-color: #000000;
    color: #ffffff;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Original design styles preserved */
.breadcrumb-area.bg-gray {
  background-color: #f8f9fa;
}

@media (prefers-color-scheme: dark) {
  .breadcrumb-area.bg-gray {
    background-color: #2d2d2d;
  }
}

/* Dark mode for breadcrumb area with bg-dark class */
.breadcrumb-area.bg-dark {
  background-color: #212529;
}

@media (prefers-color-scheme: dark) {
  .breadcrumb-area.bg-dark {
    background-color: #212529;
  }
  
  .breadcrumb-area.bg-dark .breadcrumb-item a {
    color: #8197a4;
  }
  
  .breadcrumb-area.bg-dark .breadcrumb-item a:hover {
    color: #a3b1bc;
  }
  
  .breadcrumb-area.bg-dark .breadcrumb-item.active {
    color: #aaa;
  }
  
  .breadcrumb-area.bg-dark h1 {
    color: #e0e0e0;
  }
}

.table {
  color: inherit;
}

.table td, .table th {
  vertical-align: middle;
}

.quantity-input {
  display: flex;
  align-items: center;
}

.quantity-input .quantity-down,
.quantity-input .quantity-up {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e9ecef;
  cursor: pointer;
  user-select: none;
  width: 35px;
  height: 35px;
  font-weight: bold;
}

@media (prefers-color-scheme: dark) {
  .quantity-input .quantity-down,
  .quantity-input .quantity-up {
    background-color: #444;
    color: #e0e0e0;
  }
}

.quantity-input .qty-input {
  text-align: center;
  border: 1px solid #ced4da;
  width: 60px;
  height: 35px;
}

@media (prefers-color-scheme: dark) {
  .quantity-input .qty-input {
    border-color: #444;
    background-color: #2d2d2d;
    color: #e0e0e0;
  }
}

.remove-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.divider {
  height: 1px;
  background-color: #dee2e6;
  margin: 10px 0;
}

.btn-theme {
  background-color: #5a6268;
  border-color: #5a6268;
  color: #fff;
  padding: 10px 20px;
  border-radius: 0.375rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-theme:hover {
  background-color: #495057;
  border-color: #495057;
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .btn-theme {
    background-color: #8197a4;
    border-color: #8197a4;
  }
  
  .btn-theme:hover {
    background-color: #a3b1bc;
    border-color: #a3b1bc;
  }
}

.btn-simple {
  color: #5a6268;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-simple:hover {
  color: #495057;
}

@media (prefers-color-scheme: dark) {
  .btn-simple {
    color: #8197a4;
  }
  
  .btn-simple:hover {
    color: #a3b1bc;
  }
}

.btn-outline {
  color: #5a6268;
  border: 1px solid #5a6268;
  background-color: transparent;
  padding: 10px 20px;
  border-radius: 0.375rem;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn-outline:hover {
  background-color: #5a6268;
  color: #fff;
}

@media (prefers-color-scheme: dark) {
  .btn-outline {
    color: #8197a4;
    border-color: #8197a4;
  }
  
  .btn-outline:hover {
    background-color: #8197a4;
    color: #fff;
  }
}

.empty-cart-wrapper .fa-shopping-cart {
  color: #ced4da;
}

@media (prefers-color-scheme: dark) {
  .empty-cart-wrapper .fa-shopping-cart {
    color: #666;
  }
}

.cart-summary-box .total {
  font-weight: bold;
  font-size: 1.1rem;
}

@media (prefers-color-scheme: dark) {
  .cart-summary-box .total {
    color: #8197a4;
  }
}
