/* Cart Specific Styles */
.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cart-header {
    text-align: center;
    margin-bottom: 15px;
}

.cart-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--black);
    margin: 0;
}

/* Return button unified styles */
.return-btn {
    background: var(--blue);
    color: var(--white);
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
}

.return-btn:hover {
    background: var(--light-blue);
    transform: translateY(-2px);
    color: var(--white);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.notification-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 10px;
}

.notification-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

.notification-message {
    flex: 1;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    opacity: 1;
}

/* Cart Items - виправлені стилі для правильного розташування */
.cart-content {
    display: block;
    max-width: 800px;
    margin: 0 auto;
}

.cart-items {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    margin-bottom: 0;
}

/* Десктоп версія - 4 колонки: фото - опис - кількість - сума */
.cart-item {
    display: grid;
    grid-template-columns: 120px 1fr auto auto;
    gap: 20px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
}

.cart-item:last-child {
    border-bottom: none;
}

.item-image {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-placeholder {
    font-size: 3rem;
    color: var(--text-gray);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--black);
    line-height: 1.3;
}

.item-details-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.item-sku {
    font-size: 14px;
    color: var(--text-gray);
}

.item-size-price {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.item-size {
    font-size: 14px;
    color: var(--blue);
    font-weight: 500;
}

.item-price-inline {
    font-size: 14px;
    font-weight: 500;
    color: var(--black);
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--light-gray);
    border-radius: 8px;
    padding: 5px;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: var(--white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: var(--primary-green);
    color: var(--white);
}

.quantity-input {
    width: 60px;
    height: 35px;
    border: none;
    background: var(--white);
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.item-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--black);
    text-align: center;
    min-width: 100px;
}

.remove-btn {
    background: none;
    color: #dc3545;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.remove-btn:hover {
    color: #c82333;
    transform: scale(1.05);
}

/* Discount notice */
.discount-notice {
    background: linear-gradient(135deg, #e8f5e8, #d4edda);
    border: 1px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #155724;
    font-weight: 500;
    text-align: center;
}

.single-pair-notice {
    background: linear-gradient(135deg, #fff3e0, #ffe0b3);
    border: 1px solid #ff9800;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    color: #e65100;
    font-weight: 500;
    text-align: center;
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--black);
}

.empty-cart p {
    color: var(--text-gray);
    margin-bottom: 30px;
}

/* Returning customer notice */
.returning-customer-notice {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #2196f3;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    color: #0d47a1;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.returning-customer-notice .icon {
    font-size: 1.2rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: var(--white);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(0, 160, 70, 0.1);
}

.delivery-options, .payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.delivery-option, .payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delivery-option:hover, .payment-option:hover {
    border-color: var(--primary-green);
    background: rgba(0, 160, 70, 0.05);
}

.delivery-option.selected, .payment-option.selected {
    border-color: var(--primary-green);
    background: rgba(0, 160, 70, 0.1);
}

.delivery-option input[type="radio"], .payment-option input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-green);
}

.delivery-icon {
    width: 30px;
    height: 30px;
    overflow: hidden;
    border-radius: 4px;
}

.delivery-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.delivery-text, .payment-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.order-summary {
    background: var(--light-gray);
    border-radius: 8px;
    padding: 20px;
    margin: 25px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.summary-row:last-child {
    margin-bottom: 0;
    padding-top: 15px;
    border-top: 2px solid var(--primary-green);
    font-size: 18px;
    font-weight: 700;
}

.submit-btn {
    width: auto;
    display: inline-flex;
    background: var(--primary-green);
    color: var(--white);
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
}

.submit-btn:hover:not(:disabled) {
    background: var(--light-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 160, 70, 0.3);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.form-fields-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Form validation styles */
.form-input.error, 
.delivery-option.error, 
.payment-option.error {
    border-color: #dc3545 !important;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.form-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-error-message.show {
    display: block;
}

/* Автокомпліт стилі для Нової Пошти */
.autocomplete-container {
    position: relative !important;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: var(--light-gray);
}

.autocomplete-item.loading {
    color: var(--text-gray);
    cursor: default;
    display: flex;
    align-items: center;
    gap: 10px;
}

.autocomplete-item.loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: var(--primary-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.autocomplete-item.error {
    color: #dc3545;
    cursor: default;
}

.autocomplete-item.no-results {
    color: var(--text-gray);
    cursor: default;
    font-style: italic;
}

/* Стилі для міст */
.city-name {
    font-weight: 400;
    color: #666;
    margin-bottom: 2px;
}

.city-area {
    font-size: 12px;
    color: #999;
}

/* Стилі для відділень */
.warehouse-number {
    font-weight: 400;
    color: #666;
    margin-bottom: 2px;
}

.warehouse-address {
    font-size: 12px;
    color: #999;
}

/* Анімація завантаження */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Стилі для активного автокомпліту */
.autocomplete-container input:focus {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.autocomplete-container input:focus + .autocomplete-dropdown {
    border-top: 1px solid var(--primary-green);
}

@media (max-width: 768px) {
    .cart-container {
        padding: 15px;
    }
    
    .cart-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cart-title {
        font-size: 1.5rem;
        text-align: center;
    }
    
    .cart-content {
        max-width: 100%;
    }
    
    /* Мобільна версія товару - два рядки */
    .cart-item {
        display: grid;
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        gap: 15px;
        padding: 20px 0;
        grid-template-areas:
            "image info"
            "quantity total";
    }
    
    .cart-item .item-image {
        grid-area: image;
        width: 80px;
        height: 80px;
    }
    
    .cart-item .item-info {
        grid-area: info;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    
    .cart-item .quantity-control {
        grid-area: quantity;
        justify-self: start;
        align-self: center;
    }
    
    .cart-item .item-total {
        grid-area: total;
        justify-self: end;
        align-self: center;
        text-align: right;
    }
    
    .form-fields-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .cart-items {
        padding: 20px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
    
    /* Мобільні стилі автокомпліту */
    .autocomplete-dropdown {
        max-height: 250px;
    }
    
    .autocomplete-item {
        padding: 10px 12px;
    }
}