/* Основные стили */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  background-color: #f5f5f5;
  padding: 30px 0;
  box-sizing: border-box;
}

.auth-container {
  max-width: 1280px;
  width: 100%;
}

/* Макет корзины */
.cart-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 25px;
}

/* Левая колонка - товары */
.cart-items-column {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.cart-header {
  margin-bottom: 25px;
}

.cart-title {
  color: #333;
  font-size: 20px;
  font-weight: 600;
}

/* Шапка таблицы товаров */
.cart-items-header {
  display: grid;
  grid-template-columns: minmax(300px, 4fr) 70px 100px 90px 50px;
  gap: 15px;
  padding: 10px 0;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  font-weight: 600;
  color: #555;
  font-size: 14px;
}

.header-product {
  grid-column: 1;
}

.header-price {
  grid-column: 2;
  text-align: center;
}

.header-quantity {
  grid-column: 3;
  text-align: center;
}

.header-total {
  grid-column: 4;
  text-align: center;
}

.header-actions {
  grid-column: 5;
}

/* Список товаров */
.cart-items {
  display: grid;
  gap: 15px;
}

.cart-item {
  display: grid;
  grid-template-columns: minmax(300px, 4fr) 70px 100px 90px 50px; 
  gap: 15px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
}

.item-product {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

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

.cart-item-title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-price,
.item-total {
  text-align: center;
  font-weight: 500;
  white-space: nowrap;
}

.item-total {
  color: #e72630;
  font-weight: 600;
}

.item-quantity {
  display: flex;
  justify-content: center;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  
}

.quantity-btn {
  background: #f5f5f5;
  border: none;
  width: 25px;
  height: 25px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quantity-input {
  appearance: textfield; 
  -moz-appearance: textfield;
  width: 30px;
  height: 25px;
  text-align: center;
  border: none;
  border-left: 1px solid #ddd;
  border-right: 1px solid #ddd;
  font-size: 14px;
  padding: 0;
}

/* Скрываем стрелки у числового поля */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}


.remove-item-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  transition: all 0.3s;
  width: 30px;
  height: 30px;
}

.remove-item-btn svg {
  transition: all 0.3s;
}

.remove-item-btn:hover {
  color: #e72630;
}

.remove-item-btn:hover svg,
.remove-item-btn:focus svg {
  transform: scale(1.1);
}

.remove-item-btn svg {
  width: 20px;
  height: 20px;
}

/* Правая колонка - итог */
.cart-summary-column {
  background: white;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
  height: fit-content;
}

.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.summary-title {
  color: #333;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.summary-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #555;
}

.cart-items-count {
  font-weight: 500;
}

.summary-subrow {
  font-size: 12px;
  color: #777;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.total-price {
  color: #e72630;
  font-size: 18px;
}

.cart-empty .empty-cart-message {
  text-align: center;
  color: #777;
  font-size: 16px;
  margin-bottom: 20px;
}

.checkout-btn {
  background-color: #e72630;
  color: white;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  text-align: center;
  min-width: 180px;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
  display: block;
  margin-top: 20px;
  box-sizing: border-box;
}

.checkout-btn:hover {
  background-color: #c51e26;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Стили для блока авторизации */
.auth-required-notice {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.auth-required-notice p {
  color: #6c757d;
  font-size: 14px;
  margin-bottom: 15px;
  font-weight: 500;
}

.auth-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.login-btn,
.register-btn {
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.3s;
  border: 1px solid;
}

.login-btn {
  background: #e72630;
  color: white;
  border-color: #e72630;
}

.login-btn:hover {
  background: #c51e26;
  border-color: #c51e26;
  color: white;
}

.register-btn {
  background-color: #f5f5f5;
  color: #333;
  border-color: #ccc;
}

.register-btn:hover {
  background-color: #e0e0e0;
  color: #333;
}

.cart-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.continue-shopping {
  color: #e72630;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.continue-shopping:hover {
  color: #c51e26;
}

.hidden {
  display: none;
}

.cart-item-link {
  text-decoration: none;
  color: inherit;
}

.cart-item-link:hover .cart-item-title {
  color: #e72630;
}

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

/* Скрываем мобильные элементы на десктопе */
.mobile-controls-row {
  display: none;
}



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

@media (max-width: 768px) {
  .cart-items-header {
    display: none;
  }
  
  .cart-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 8px;
    position: relative;
    align-items: flex-start;
  }
  
  .item-product {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    align-self: flex-start;
  }
  
  .mobile-controls-row {
    display: grid;
    grid-template-columns: minmax(60px, 1fr) minmax(80px, 1fr) minmax(70px, 1fr) auto;
    gap: 10px;
    align-items: start;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    width: 100%;
    align-self: flex-start;
  }
  
  .mobile-price-block,
  .mobile-quantity-block,
  .mobile-total-block {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  
  .mobile-label {
    font-size: 12px;
    color: #777;
    font-weight: 500;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 5px;
    height: 14px;
    display: flex;
    align-items: center;
  }
  
  .mobile-value {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
  }
  
  .mobile-total-block .mobile-value {
    color: #e72630;
  }
  
  .mobile-quantity-block .quantity-control {
    margin: 0;
    margin-top: auto;
    width: fit-content;
    max-width: 100%;
  }
  
  .item-price,
  .item-total,
  .item-quantity,
  .item-actions {
    display: none;
  }
  
  .mobile-remove-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    width: 36px;
    height: 36px;
    margin-top: 19px;
  }
  
  .mobile-remove-btn:hover {
    background: #fff5f5;
    border-color: #e72630;
    color: #e72630;
  }
  
  .mobile-remove-btn svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 576px) {
  .cart-items-column,
  .cart-summary-column {
    padding: 20px;
  }
  
  .cart-item-image {
    width: 50px;
    height: 50px;
  }
  
  .auth-buttons {
    flex-direction: column;
  }
}

@media (max-width: 488px) {
  .checkout-btn {
    font-size: 13px;
    padding: 12px 16px;
    min-width: 160px;
  }
}

@media (max-width: 390px) {
  .cart-items-column,
  .cart-summary-column {
    padding: 15px;
  }
  
  .cart-item {
    padding: 12px;
  }
  
  .cart-item-image {
    width: 45px;
    height: 45px;
  }
  
  .mobile-controls-row {
    grid-template-columns: minmax(50px, 1fr) minmax(70px, 1fr) minmax(60px, 1fr) auto;
    gap: 8px;
  }
  
  .mobile-label {
    font-size: 11px;
  }
  
  .mobile-value {
    font-size: 13px;
  }
  
  .quantity-control {
    scale: 0.9;
  }
  
  .mobile-remove-btn {
    width: 32px;
    height: 32px;
  }
  
  .mobile-remove-btn svg {
    width: 16px;
    height: 16px;
  }
}