/* Cart styles */

/* Уведомления корзины */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    max-width: 300px;
    min-width: 200px;
}

.cart-notification i {
    font-size: 16px;
}

/* Кнопка корзины в шапке */
.cart-icon {
    position: relative;
    display: inline-block;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
}

/* Cart page layout - современный дизайн */
.cart-page { 
    max-width: 1200px; 
    margin: 2rem auto; 
    padding: 0 1rem; 
}

.cart-header {
    margin-bottom: 2rem;
}

.cart-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-header h1 i {
    color: #b77b3b;
}

/* Пустая корзина */
.cart-empty { 
    padding: 4rem 2rem; 
    background: #fff; 
    border-radius: 16px; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

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

.cart-empty p {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Основной контент */
.cart-content { 
    display: grid; 
    grid-template-columns: 1fr 380px; 
    gap: 2rem; 
    align-items: start;
}

/* Товары */
.cart-items { 
    display: flex; 
    flex-direction: column; 
    gap: 1rem; 
}

.cart-item { 
    display: grid;
    grid-template-columns: 120px 1fr auto;
    gap: 1.25rem;
    padding: 1.25rem; 
    border: 1px solid #eee; 
    border-radius: 12px; 
    background: #fff; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease;
}

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

.item-image-wrapper {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f8f8;
}

.item-image { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.item-info { 
    display: flex; 
    flex-direction: column; 
    gap: 0.5rem;
    min-width: 0;
}

.item-name { 
    font-weight: 600; 
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.item-price { 
    color: #888; 
    font-size: 0.95rem; 
}

.item-actions { 
    display: flex; 
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    justify-content: flex-end;
}

.item-total { 
    font-weight: 700; 
    font-size: 1.25rem;
    color: #b77b3b;
}

.remove-item { 
    background: rgba(220, 53, 69, 0.1); 
    border: none; 
    color: #dc3545; 
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 1.25rem; 
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item:hover {
    background: #dc3545;
    color: #fff;
}

/* Итоговая сводка */
.cart-summary { 
    border: 1px solid #eee; 
    border-radius: 16px; 
    padding: 1.5rem; 
    height: fit-content; 
    background: #fff; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 2rem;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 1rem 0;
}

.summary-row { 
    display: flex; 
    justify-content: space-between; 
    margin: 0.75rem 0; 
    font-size: 1rem;
    color: #666;
}

.summary-row span:last-child {
    font-weight: 600;
    color: #333;
}

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

.summary-row.total { 
    font-size: 1.5rem; 
    font-weight: 700; 
    margin-top: 1rem;
    color: #333;
}

.summary-row.total span:last-child {
    color: #b77b3b;
}

/* Кнопки */
.btn { 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem; 
    border-radius: 8px; 
    background: #b77b3b; 
    color: #fff; 
    text-decoration: none; 
    border: none; 
    cursor: pointer; 
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.btn:hover {
    background: #a06a30;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(183, 123, 59, 0.3);
}

.btn-catalog {
    background: #333;
}

.btn-catalog:hover {
    background: #555;
}

.btn-primary { 
    background: #b77b3b; 
}

/* Order form */
.order-form { 
    margin-top: 1.5rem; 
    display: grid; 
    gap: 1rem; 
}

.order-form .form-row { 
    display: grid; 
    gap: 0.5rem; 
}

.order-form label { 
    font-size: 0.95rem; 
    color: #444; 
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-form label i {
    color: #b77b3b;
}

.order-form input { 
    padding: 0.875rem 1rem; 
    border: 2px solid #eee; 
    border-radius: 8px; 
    font-size: 1rem;
    transition: all 0.3s ease;
}

.order-form input:focus { 
    outline: none; 
    border-color: #b77b3b; 
    box-shadow: 0 0 0 3px rgba(183, 123, 59, 0.1); 
}

/* Адаптивность - планшеты */
@media (max-width: 900px) {
    .cart-content { 
        grid-template-columns: 1fr; 
    }
    
    .cart-summary {
        position: static;
    }
}

/* Кнопки товаров */
.add-to-cart {
    transition: all 0.3s ease;
    position: relative;
}

.add-to-cart.in-cart {
    background: #6c757d;
    border-color: #6c757d;
    font-size: 0.9em;
    padding: 8px 16px;
    min-height: 40px;
}

.add-to-cart.in-cart:hover {
    background: #5a6268;
    border-color: #5a6268;
}

/* Контролы количества */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0;
    flex-wrap: nowrap;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #b77b3b;
    background: white;
    color: #b77b3b;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    vertical-align: middle;
}

.quantity-btn:hover {
    background: #b77b3b;
    color: white;
}

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

.quantity-display {
    font-weight: bold;
    color: #333;
    min-width: 30px;
    text-align: center;
    font-size: 16px;
    line-height: 32px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

/* Адаптивность - мобильные */
@media (max-width: 768px) {
    .cart-page {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }
    
    .cart-header h1 {
        font-size: 1.5rem;
    }
    
    .cart-empty {
        padding: 3rem 1.5rem;
    }
    
    .empty-cart-icon {
        font-size: 3rem;
    }
    
    .cart-empty p {
        font-size: 1.1rem;
    }
    
    /* Товары - мобильный layout (вертикальный) */
    .cart-item {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .item-image-wrapper {
        width: 100%;
        height: 200px;
        border-radius: 12px;
    }
    
    .item-info {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .item-name {
        font-size: 1.1rem;
    }
    
    .item-price {
        font-size: 0.9rem;
        color: #888;
    }
    
    .item-actions {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
        align-items: center;
        padding-top: 0.75rem;
        border-top: 1px solid #f0f0f0;
    }
    
    .item-actions .quantity-controls {
        margin-top: 0;
        justify-content: flex-start;
    }
    
    .item-total {
        font-size: 1.25rem;
        font-weight: 700;
        color: #b77b3b;
        text-align: center;
    }
    
    .remove-item {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        justify-self: end;
    }
    
    /* Сводка */
    .cart-summary {
        padding: 1.25rem;
    }
    
    .summary-title {
        font-size: 1.25rem;
    }
    
    .summary-row.total {
        font-size: 1.25rem;
    }
    
    /* Уведомления */
    .cart-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 14px;
    }
    
    .cart-badge {
        right: 20px;
        margin-top: 8px;
    }
    
    /* Контролы количества */
    .quantity-controls {
        gap: 8px;
        margin-top: 0.5rem;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }
    
    .quantity-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        flex-shrink: 0;
    }
    
    .quantity-display {
        font-size: 16px;
        min-width: 32px;
        line-height: 36px;
        flex-shrink: 0;
    }
    
    /* Кнопка добавления в корзину */
    .add-to-cart.in-cart {
        min-height: 40px;
        font-size: 0.85em;
        padding: 8px 12px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .cart-header h1 {
        font-size: 1.25rem;
    }
    
    .cart-item {
        padding: 0.875rem;
        gap: 0.875rem;
    }
    
    .item-image-wrapper {
        height: 180px;
    }
    
    .item-name {
        font-size: 1rem;
    }
    
    .item-price {
        font-size: 0.875rem;
    }
    
    .item-actions {
        gap: 0.75rem;
    }
    
    .item-total {
        font-size: 1.125rem;
    }
    
    .remove-item {
        width: 38px;
        height: 38px;
        font-size: 1.05rem;
    }
    
    .summary-title {
        font-size: 1.125rem;
    }
    
    .summary-row {
        font-size: 0.925rem;
    }
    
    .summary-row.total {
        font-size: 1.125rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.925rem;
    }
    
    /* Контролы количества */
    .quantity-controls {
        gap: 6px;
        margin-top: 0;
    }
    
    .quantity-btn {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
    
    .quantity-display {
        font-size: 15px;
        min-width: 30px;
        line-height: 34px;
    }
    
    .add-to-cart.in-cart {
        min-height: 38px;
        font-size: 0.8em;
        padding: 6px 10px;
    }
}