/* ============================================
   cart.css - СТИЛИ СТРАНИЦЫ КОРЗИНЫ
   ============================================ */

/* ===== ОБЩИЙ ФОН ===== */
body {
    min-height: 100vh;
    background: #f5f7fa;
    background-image: url('/photo/background.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

/* ===== КОНТЕЙНЕР ===== */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 60px;
    position: relative;
    z-index: 1;
}

.cart-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -1px;
    margin-bottom: 30px;
}

.cart-title span {
    font-weight: 400;
    opacity: 0.5;
}

/* ===== СЕТКА ===== */
.cart-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
}

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

/* ===== ТОВАРЫ ===== */
.cart-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== ПУСТАЯ КОРЗИНА ===== */
.cart-empty {
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.cart-empty .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.cart-empty h3 {
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.cart-empty p {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 24px;
}

/* ===== КНОПКИ ===== */
.btn-primary {
    display: inline-block;
    padding: 14px 40px;
    background: #1a1a1a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #333;
}

/* ===== КАРТОЧКА ТОВАРА ===== */
.cart-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
    will-change: transform, opacity;
}

.cart-item:hover {
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
    }
}

.cart-item-img {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f0f0f0;
}

@media (max-width: 768px) {
    .cart-item-img {
        width: 100%;
        height: 200px;
    }
}

.cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cart-item-name {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cart-item-sizes {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.size-link {
    display: inline-block;
    padding: 4px 12px;
    border: 1.5px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 0.65rem;
    font-weight: 600;
    text-decoration: none;
    color: #666;
    transition: all 0.2s;
    cursor: pointer;
}

.size-link:hover:not(.out-of-stock):not(.active) {
    border-color: #1a1a1a;
    background: #f5f5f5;
}

.size-link.active {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: white;
}

.size-link.out-of-stock {
    opacity: 0.3;
    cursor: not-allowed;
    text-decoration: line-through;
    pointer-events: none;
}

.cart-item-stock {
    font-size: 0.6rem;
    color: #888;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

.cart-item-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.4;
    transition: opacity 0.3s;
    color: #1a1a1a;
    padding: 4px 8px;
    border-radius: 50%;
}

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

.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

/* ===== КНОПКИ КОЛИЧЕСТВА ===== */
.qty-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qty-btn {
    background: #1a1a1a;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover:not(:disabled) {
    background: #333;
}

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

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

.qty-value {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.item-total {
    font-size: 1rem;
    font-weight: 700;
}

/* ===== ИТОГИ ===== */
.cart-summary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 80px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    color: #666;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0 8px 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a1a;
    border-top: 1px solid #e8e8e8;
    margin-top: 8px;
}

/* ===== КНОПКА ОФОРМЛЕНИЯ ===== */
.checkout-btn {
    background: #1a1a1a;
    color: white;
    border: none;
    padding: 14px;
    width: 100%;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 12px;
    text-decoration: none;
    display: block;
    text-align: center;
}

.checkout-btn:hover:not(.disabled) {
    background: #333;
}

.checkout-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===== ПРОМОКОД ===== */
.promo-section {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.promo-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 8px;
}

.promo-form {
    display: block;
    width: 100%;
}

.promo-input-wrapper {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.promo-input {
    flex: 1;
    padding: 8px 14px;
    background: #ffffff;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #1a1a1a;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
    min-width: 0;
    height: 38px;
}

.promo-input::placeholder {
    color: #aaa;
    font-size: 0.8rem;
}

.promo-input:focus {
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.promo-input:hover {
    border-color: #888;
}

.promo-apply-btn {
    padding: 8px 18px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.3px;
}

.promo-apply-btn:hover {
    background: #333;
}

.promo-apply-btn:active {
    transform: scale(0.96);
}

.promo-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #d4edda;
    border-radius: 6px;
    border: 1px solid #c3e6cb;
    gap: 10px;
}

.promo-applied-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.promo-applied-code {
    color: #155724;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.promo-applied-discount {
    color: #155724;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(40, 167, 69, 0.15);
    padding: 2px 10px;
    border-radius: 4px;
}

.btn-remove-promo {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.btn-remove-promo:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}

.promo-error {
    background: #f8d7da;
    color: #721c24;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 8px;
    border: 1px solid #f5c6cb;
}

.promo-success {
    background: #d4edda;
    color: #155724;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    margin-top: 8px;
    border: 1px solid #c3e6cb;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

.notification-container .notification {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-left: 4px solid #28a745;
    animation: slideInRight 0.4s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.notification-container .notification.error {
    border-left-color: #dc3545;
}

.notification-container .notification.warning {
    border-left-color: #ff9800;
}

.notification-container .notification .icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notification-container .notification .content {
    flex: 1;
    font-size: 0.9rem;
    color: #1a1a1a;
    line-height: 1.4;
}

.notification-container .notification .content .title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.notification-container .notification .content .message {
    color: #666;
    font-size: 0.8rem;
}

.notification-container .notification .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #999;
    padding: 0 4px;
    flex-shrink: 0;
    transition: color 0.3s;
}

.notification-container .notification .close-btn:hover {
    color: #1a1a1a;
}

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

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

.notification-container .notification.hiding {
    animation: slideOutRight 0.3s ease forwards;
}

@media (max-width: 768px) {
    .notification-container {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    .notification-container .notification {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    
    .promo-section {
        padding: 10px 14px;
    }
    
    .promo-input-wrapper {
        gap: 6px;
    }
    
    .promo-input {
        padding: 6px 12px;
        font-size: 0.8rem;
        height: 34px;
    }
    
    .promo-apply-btn {
        padding: 6px 14px;
        font-size: 0.7rem;
        height: 34px;
    }
}

@media (max-width: 480px) {
    .promo-section {
        padding: 8px 12px;
    }
    
    .promo-input-wrapper {
        flex-direction: column;
        gap: 6px;
    }
    
    .promo-input {
        width: 100%;
        height: 36px;
    }
    
    .promo-apply-btn {
        width: 100%;
        height: 36px;
    }
    
    .promo-applied {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .promo-applied-info {
        justify-content: center;
    }
    
    .btn-remove-promo {
        width: 100%;
        justify-content: center;
    }
}




/* Стиль для отображения размера текстом */
.cart-item-size-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 4px 0;
}

.cart-item-size-display .size-label {
    font-size: 0.75rem;
    color: #999;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.cart-item-size-display .size-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff !important;
    background: #1a1a1a !important;
    padding: 4px 14px !important;
    border-radius: 4px !important;
    border: none !important;
    display: inline-block;
    min-width: 32px;
    text-align: center;
}

/* ============================================
   МОБИЛЬНЫЕ УЛУЧШЕНИЯ ДЛЯ КОРЗИНЫ
   ============================================ */

@media (max-width: 768px) {
    .cart-container {
        padding: 12px 12px 40px;
    }
    
    .cart-title {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
    
    .cart-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cart-item {
        flex-direction: row;
        padding: 14px;
        gap: 14px;
    }
    
    .cart-item-img {
        width: 80px;
        height: 110px;
        flex-shrink: 0;
    }
    
    .cart-item-name {
        font-size: 0.9rem;
    }
    
    .size-link {
        padding: 3px 10px;
        font-size: 0.6rem;
        min-height: 32px;
        min-width: 32px;
    }
    
    .qty-btn {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
        min-height: 30px;
        min-width: 30px;
    }
    
    .qty-value {
        font-size: 0.85rem;
        min-width: 16px;
    }
    
    .item-total {
        font-size: 0.85rem;
    }
    
    .summary-card {
        padding: 16px;
        position: relative;
        top: 0;
    }
    
    .checkout-btn {
        padding: 14px;
        font-size: 0.75rem;
        min-height: 48px;
    }
}

@media (max-width: 480px) {
    .cart-item {
        flex-direction: column;
        padding: 12px;
        gap: 10px;
    }
    
    .cart-item-img {
        width: 100%;
        height: 160px;
    }
    
    .cart-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .cart-item-remove {
        align-self: flex-end;
    }
    
    .cart-item-name {
        font-size: 0.85rem;
    }
    
    .cart-item-sizes {
        gap: 4px;
    }
    
    .size-link {
        padding: 2px 8px;
        font-size: 0.55rem;
        min-height: 28px;
    }
    
    .cart-item-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .qty-controls {
        justify-content: center;
    }
    
    .qty-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .item-total {
        text-align: center;
        font-size: 1rem;
    }
    
    .summary-row {
        font-size: 0.8rem;
    }
    
    .summary-total {
        font-size: 1rem;
    }
}