/**
 * ECD Quick Checkout - Stylesheet
 * 
 * @author Remus-Costin Crinjala
 */

.ecd-quick-checkout-wrapper {
    margin: 10px 0;
    display: inline-block;
    vertical-align: top;
    width: 100%;
}

.ecd-quick-checkout-wrapper:not(:only-child) {
    width: 49%;
}

.ecd-quick-checkout-wrapper:not(:only-child):last-child {
    margin-right: 0;
}

.ecd-quick-checkout-btn {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecd-quick-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.ecd-quick-checkout-btn:active {
    transform: translateY(0);
}

.ecd-quick-checkout-btn .material-icons {
    font-size: 24px;
}

.ecd-qc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ecd-qc-modal.active {
    visibility: visible;
    opacity: 1;
}

.ecd-qc-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.ecd-qc-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 95vh;
    background: #fff;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}

.ecd-qc-modal.active .ecd-qc-content {
    transform: translateY(0);
}

.ecd-qc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 2px solid #f0f0f0;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 199;
    border-radius: 24px 24px 0 0;
}

.ecd-qc-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #333;
}

.ecd-qc-close {
    background: none;
    border: none;
    font-size: 36px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ecd-qc-close:hover {
    background: #f5f5f5;
    color: #333;
}

.ecd-qc-body {
    padding: 30px;
}

.ecd-qc-loading {
    text-align: center;
    padding: 60px 20px;
}

.ecd-qc-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: ecd-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.ecd-qc-spinner-small {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: ecd-spin 1s linear infinite;
    margin: 10px auto;
}

@keyframes ecd-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ecd-qc-guest-login {
    text-align: center;
    padding: 40px 20px;
}

.ecd-qc-info-box {
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.ecd-qc-info-box .material-icons {
    color: #2196f3;
    font-size: 32px;
}

.ecd-qc-info-box p {
    margin: 0;
    color: #1565c0;
    font-weight: 500;
}

.ecd-qc-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.ecd-qc-action-buttons .btn {
    min-width: 150px;
}

.ecd-qc-product-summary {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.ecd-qc-product-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ecd-qc-product-info {
    flex: 1;
}

.ecd-qc-product-info h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.ecd-qc-quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ecd-qc-quantity-selector label {
    margin: 0;
    font-weight: 600;
    color: #555;
}

.ecd-qc-qty-input {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ecd-qc-qty-btn {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    transition: background 0.2s;
}

.ecd-qc-qty-btn:hover {
    background: #5568d3;
}

.ecd-qc-qty-input input {
    border: none;
    width: 60px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 5px;
}

.ecd-qc-section {
    margin-bottom: 25px;
}

.ecd-qc-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ecd-qc-section h4 .material-icons {
    font-size: 22px;
    color: #667eea;
}

.ecd-qc-section .form-control {
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    padding: 6px 15px;
    font-size: 15px;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.ecd-qc-section .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.ecd-qc-payment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ecd-qc-payment-item {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.ecd-qc-payment-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.ecd-qc-payment-item input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.ecd-qc-payment-item:has(input:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.ecd-qc-payment-item label {
    cursor: pointer;
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
}

.ecd-qc-payment-name {
    font-weight: 600;
    color: #333;
}

.ecd-qc-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    border-radius: 12px;
    margin: 25px 0;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.ecd-qc-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
}

.ecd-qc-summary-row.ecd-qc-total {
    font-size: 22px;
    font-weight: 700;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding-top: 15px;
    margin-top: 15px;
    margin-bottom: 0;
}

.ecd-qc-actions {
    text-align: center;
    padding: 10px 0;
}

.ecd-qc-actions .btn {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.ecd-qc-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.ecd-qc-actions .material-icons {
    font-size: 24px;
}

.ecd-qc-error-msg {
    background: #ffebee;
    border: 2px solid #ef5350;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #c62828;
    font-weight: 500;
}

.ecd-qc-error-msg .material-icons {
    color: #ef5350;
}

body.ecd-qc-open {
    overflow: hidden;
}

@media (min-width: 768px) {
    .ecd-qc-content {
        left: 50%;
        transform: translate(-50%, 100%);
        max-width: 700px;
        width: 100%;
        border-radius: 24px;
        bottom: auto;
        top: 50%;
        max-height: 90vh;
    }
    
    .ecd-qc-modal.active .ecd-qc-content {
        transform: translate(-50%, -50%);
    }

    .ecd-qc-product-summary {
        flex-direction: row;
    }

    .ecd-qc-product-img {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 767px) {
    .ecd-qc-product-summary {
        flex-direction: column;
        text-align: center;
    }

    .ecd-qc-product-img {
        margin: 0 auto;
    }

    .ecd-qc-quantity-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .ecd-qc-qty-input {
        justify-content: center;
    }

    .ecd-qc-action-buttons {
        flex-direction: column;
    }

    .ecd-qc-action-buttons .btn {
        width: 100%;
    }

    .ecd-qc-header h2 {
        font-size: 20px;
    }

    .ecd-qc-body {
        padding: 20px 15px;
    }
}

.ecd-qc-section .form-group {
    margin-bottom: 15px;
}

.ecd-qc-section .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.ecd-qc-section .form-group input,
.ecd-qc-section .form-group select {
    width: 100%;
    box-sizing: border-box;
}

.ecd-qc-section select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.ecd-qc-section .row {
    margin-left: -7.5px;
    margin-right: -7.5px;
}

.ecd-qc-section .row > [class*="col-"] {
    padding-left: 7.5px;
    padding-right: 7.5px;
}

#ecd-qc-carriers-loading,
#ecd-qc-carriers-loading-guest {
    text-align: center;
    padding: 10px;
}

/* Mobile: buttons stacked */
@media (max-width: 768px) {
    .ecd-quick-checkout-wrapper {
        display: block;
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 10px;
    }
    
    .ecd-quick-checkout-btn {
        width: 100%;
    }
}
