/* public/css/checkout.css */

.checkout-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 40px;
    align-items: start;
}

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

@media (max-width: 768px) {
    .checkout-container {
        margin: 10px auto;
        padding: 0 10px;
        gap: 15px;
    }
    .checkout-section-title {
        display: none !important;
    }
    .checkout-block {
        padding: 15px !important;
        margin-bottom: 15px !important;
    }
    .checkout-block-title {
        margin-bottom: 15px !important;
    }
}

.checkout-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--color-text);
}

.checkout-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.checkout-block-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkout-block-title i {
    color: var(--color-primary);
}

/* Custom Inputs & Floating Labels */
.custom-input-group {
    margin-bottom: 20px;
    position: relative;
}

.custom-input-group label {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--color-text-muted);
    pointer-events: none;
    transition: all 0.2s ease-out;
    background: transparent;
    padding: 0 4px;
    margin-bottom: 0;
}

.custom-input {
    width: 100%;
    padding: 22px 20px 8px 20px; /* Space at top for floating label */
    font-size: 1rem;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--color-text);
    transition: var(--transition-fast);
    box-sizing: border-box;
    font-family: inherit;
    height: 60px;
}

.custom-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.custom-input:focus ~ label,
.custom-input:not(:placeholder-shown) ~ label,
.custom-input:disabled ~ label {
    top: 18px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-input:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
}

.custom-input:disabled ~ label {
    color: #94a3b8;
}

/* Radio Cards (Delivery & Payment) */
.radio-cards-grid {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.radio-card {
    position: relative;
    cursor: pointer;
    flex: 1;
}

.radio-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 5px;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 12px;
    transition: var(--transition-fast);
    height: 100%;
    box-sizing: border-box;
}

.radio-card input:checked + .radio-card-content {
    border-color: var(--color-primary);
    background: rgba(37, 99, 235, 0.05);
}

.radio-card-title {
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0;
    color: var(--color-text);
    line-height: 1.2;
}
.radio-card-desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Payment specific vertical layout */
.radio-cards-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.radio-cards-vertical .radio-card-content {
    flex-direction: row;
    align-items: center;
    gap: 15px;
}
.radio-cards-vertical .radio-card-text {
    display: flex;
    flex-direction: column;
}

/* Dropdown list for Nova Poshta */
.np-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    padding: 8px;
}

.np-dropdown li {
    list-style: none;
    padding: 12px 15px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--color-text);
    transition: var(--transition-fast);
}

.np-dropdown li:hover {
    background: #f1f5f9;
    color: var(--color-primary);
}

/* Checkout Summary Section */
.checkout-summary-block {
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 30px;
    position: sticky;
    top: 100px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
}

.checkout-summary-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 25px;
}

.checkout-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}
.checkout-item:last-child {
    border-bottom: none;
}

.checkout-item-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    padding: 5px;
    flex-shrink: 0;
}
.checkout-item-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.checkout-item-details {
    flex-grow: 1;
}

.checkout-item-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.checkout-item-qty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.checkout-item-price {
    font-weight: 800;
    white-space: nowrap;
}

.checkout-totals-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1rem;
    color: var(--color-text-muted);
}

.checkout-totals-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px dashed var(--color-border);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-text);
}

.checkout-totals-final .price {
    font-size: 1.8rem;
    color: var(--color-primary);
}

/* Submit Button */
.checkout-submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.4);
    transition: var(--transition-bounce);
    margin-top: 25px;
}

.checkout-submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(37, 99, 235, 0.5);
}

.checkout-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    cursor: pointer;
}
.checkout-checkbox-group input {
    margin-top: 3px;
    accent-color: var(--color-primary);
    width: 16px;
    height: 16px;
}
.checkout-checkbox-group span {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}
.checkout-checkbox-group a {
    color: var(--color-primary);
    text-decoration: underline;
}
