/* Cart Page Styles */

/* Breadcrumbs */
.breadcrumbs {
  background-color: #f9f1ea;
  padding: 1rem 0;
  border-bottom: 1px solid #f3d3b4;
}
/* ========================================
   СООБЩЕНИЯ / ALERTS
   ======================================== */

.messages-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    width: 100%;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.5;
}

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

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
    font-weight: 500;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.alert-close:hover {
    opacity: 1;
}

/* Типы сообщений */
.alert-success {
    border-left-color: #10b981;
    background: #ecfdf5;
    color: #065f46;
}

.alert-success .alert-icon {
    color: #10b981;
}

.alert-error {
    border-left-color: #ef4444;
    background: #fef2f2;
    color: #991b1b;
}

.alert-error .alert-icon {
    color: #ef4444;
}

.alert-warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.alert-warning .alert-icon {
    color: #f59e0b;
}

.alert-info {
    border-left-color: #3b82f6;
    background: #eff6ff;
    color: #1e40af;
}

.alert-info .alert-icon {
    color: #3b82f6;
}

/* Автоматическое исчезновение */
.alert-dismissible {
    animation: slideInRight 0.3s ease-out, fadeOut 0.3s ease-out 4.7s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(400px);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .messages-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .alert {
        padding: 12px 16px;
        font-size: 13px;
    }
}
.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: #3c332c;
}

.breadcrumb-link {
  color: #3c332c;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-link:hover {
  color: #1e1b17;
}

.breadcrumb-item.active {
  color: #1e1b17;
  font-weight: 500;
}

/* Cart Page */
.cart-page {
  padding: 2rem 0 4rem;
  min-height: 60vh;
}

/* Cart Header */
.cart-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1e1b17;
  margin-bottom: 1.5rem;
}

.cart-steps {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #9ca3af;
}

.step.active {
  color: #1e1b17;
}

.step-number {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #e5e7eb;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.step.active .step-number {
  background-color: #1e1b17;
  color: white;
}

.step-label {
  font-weight: 500;
  font-size: 0.875rem;
}

.step-divider {
  width: 2rem;
  height: 1px;
  background-color: #e5e7eb;
}

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

/* Cart Items Section */
.cart-items-section {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid #f3d3b4;
}

.cart-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f3d3b4;
}

.cart-items-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e1b17;
}

.clear-cart-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.3s ease;
  font-size: 0.875rem;
}

.clear-cart-btn:hover {
  background-color: #fef2f2;
}

/* Cart Items */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  background-color: #fafafa;
  transition: box-shadow 0.3s ease;
}

.cart-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-image img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.item-details {
  min-width: 0;
}

.item-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.item-name a {
  color: #1e1b17;
  text-decoration: none;
  transition: color 0.3s ease;
}

.item-name a:hover {
  color: #3c332c;
}

.item-options {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.option {
  font-size: 0.875rem;
  color: #6b7280;
}

.item-availability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #22c55e;
}

.item-quantity {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.quantity-label {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: 500;
}

.quantity-controls {
  display: flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  background-color: white;
}

.quantity-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s ease;
}

.quantity-btn:hover:not(:disabled) {
  background-color: #f3f4f6;
  color: #1e1b17;
}

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

.quantity-input {
  width: 3rem;
  height: 2rem;
  border: none;
  text-align: center;
  font-weight: 500;
  background: none;
}

.quantity-input:focus {
  outline: none;
}

.item-price {
  text-align: center;
}

.current-price {
  font-size: 1rem;
  font-weight: 600;
  color: #1e1b17;
}

.old-price {
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: line-through;
}

.discount {
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 600;
}

.item-total {
  text-align: center;
}

.total-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e1b17;
}

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.action-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #d1d5db;
  background-color: white;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background-color: #f3f4f6;
}

.wishlist-btn {
  color: #ef4444;
}

.wishlist-btn.active {
  background-color: #fef2f2;
  border-color: #ef4444;
}

.remove-btn {
  color: #ef4444;
}

.remove-btn:hover {
  background-color: #fef2f2;
  border-color: #ef4444;
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-cart-icon {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

.empty-cart h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 0.5rem;
}

.empty-cart p {
  color: #6b7280;
  margin-bottom: 2rem;
}

/* Continue Shopping */
.continue-shopping {
  margin-top: 1rem;
}

.continue-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #3c332c;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.continue-link:hover {
  color: #1e1b17;
}

/* Cart Summary Section */
.cart-summary-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cart-summary {
  background-color: white;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  padding: 1.5rem;
  position: sticky;
  top: 2rem;
}

.cart-summary h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.summary-row.total {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e1b17;
  margin-bottom: 1rem;
}

.discount-amount {
  color: #22c55e;
  font-weight: 600;
}

.delivery-cost.free {
  color: #22c55e;
  font-weight: 600;
}

.summary-divider {
  height: 1px;
  background-color: #e5e7eb;
  margin: 1rem 0;
}

.savings-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f0fdf4;
  padding: 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 1.5rem;
  color: #22c55e;
  font-size: 0.875rem;
}

/* Promo Code */
.promo-code-section {
  margin-bottom: 1.5rem;
}

.promo-code-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 0.75rem;
}

.promo-input-group {
  display: flex;
  gap: 0.5rem;
}

.promo-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.promo-input:focus {
  outline: none;
  border-color: #1e1b17;
}

.promo-btn {
  padding: 0.75rem 1rem;
  background-color: #1e1b17;
  color: white;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.promo-btn:hover {
  background-color: #3c332c;
}

.promo-message {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.promo-message.success {
  color: #22c55e;
}

.promo-message.error {
  color: #ef4444;
}

/* Delivery Options */
.delivery-options {
  margin-bottom: 1.5rem;
}

.delivery-options h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 0.75rem;
}

.delivery-option {
  margin-bottom: 0.5rem;
}

.delivery-option input[type="radio"] {
  display: none;
}

.delivery-option label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delivery-option input[type="radio"]:checked + label {
  border-color: #1e1b17;
  background-color: #f9f1ea;
}

.option-info {
  flex: 1;
}

.option-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: #1e1b17;
  margin-bottom: 0.25rem;
}

.option-details {
  font-size: 0.875rem;
  color: #6b7280;
}

.option-price {
  font-weight: 600;
  color: #1e1b17;
}

/* Payment Methods */
.payment-methods {
  margin-bottom: 1.5rem;
}

.payment-methods h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 0.75rem;
}

.payment-icons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.payment-icon {
  width: 3rem;
  height: 2rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.payment-icon:hover {
  border-color: #1e1b17;
  color: #1e1b17;
}

/* Checkout Button */
.checkout-btn {
  width: 100%;
  padding: 1rem;
  background-color: #1e1b17;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  transition: background-color 0.3s ease;
}

.checkout-btn:hover {
  background-color: #3c332c;
}

.checkout-btn:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

/* Security Info */
.security-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.security-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.security-item i {
  color: #22c55e;
}

/* Recommended Products */
.recommended-products {
  background-color: white;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.recommended-products h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 1rem;
}

.recommended-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #f3d3b4;
  border-radius: 0.375rem;
  margin-bottom: 0.75rem;
  transition: box-shadow 0.2s ease;
}

.recommended-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.recommended-item:last-child {
  margin-bottom: 0;
}

.recommended-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.375rem;
}

.recommended-info {
  flex: 1;
}

.recommended-info h5 {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e1b17;
  margin-bottom: 0.25rem;
}

.recommended-price {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e1b17;
}

.add-recommended-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid #1e1b17;
  background-color: white;
  border-radius: 0.375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1e1b17;
  transition: all 0.2s ease;
}

.add-recommended-btn:hover {
  background-color: #1e1b17;
  color: white;
}

/* Recently Viewed */
.recently-viewed {
  margin-top: 3rem;
}

.recently-viewed h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 1.5rem;
}

.products-slider {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background-color: white;
  border: 1px solid #f3d3b4;
  border-radius: 0.5rem;
  padding: 1rem;
  transition: box-shadow 0.3s ease;
}

.product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-card .product-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.product-card .product-info h4 {
  font-size: 1rem;
  font-weight: 500;
  color: #1e1b17;
  margin-bottom: 0.5rem;
}

.product-card .product-price {
  font-size: 1rem;
  font-weight: 600;
  color: #1e1b17;
  margin-bottom: 1rem;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Responsive Design */
@media (min-width: 768px) {
  .cart-content {
    grid-template-columns: 2fr 1fr;
  }

  .cart-item {
    grid-template-columns: auto 2fr auto auto auto auto;
  }

  .item-quantity {
    align-items: flex-start;
  }

  .security-info {
    flex-direction: row;
    justify-content: space-between;
  }

  .payment-icons {
    justify-content: space-between;
  }
}

@media (max-width: 767px) {
  .cart-item {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
  }

  .item-image {
    justify-self: center;
  }

  .item-actions {
    flex-direction: row;
    justify-content: center;
  }

  .cart-steps {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .step-label {
    display: none;
  }

  .cart-items-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .promo-input-group {
    flex-direction: column;
  }

  .products-slider {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .cart-page {
    padding: 1rem 0 2rem;
  }

  .cart-items-section,
  .cart-summary {
    padding: 1rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .item-image img {
    width: 100px;
    height: 100px;
  }
}

/* Animation for cart updates */
@keyframes cartItemRemove {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-100%);
  }
}

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

@keyframes cartItemAdd {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.cart-item.adding {
  animation: cartItemAdd 0.3s ease-out;
}

/* Loading states */
.checkout-btn.loading {
  position: relative;
  color: transparent;
}

.checkout-btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Focus styles for accessibility */
.quantity-btn:focus,
.action-btn:focus,
.promo-btn:focus,
.checkout-btn:focus,
.add-recommended-btn:focus {
  outline: 2px solid #1e1b17;
  outline-offset: 2px;
}

.delivery-option input[type="radio"]:focus + label {
  outline: 2px solid #1e1b17;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .cart-item,
  .cart-summary,
  .recommended-products {
    border-width: 2px;
  }

  .checkout-btn:focus,
  .promo-btn:focus {
    outline-width: 3px;
  }
}
