/*
 * Styles for the Order Checkout form
 *
 * These styles improve the visual layout of the custom checkout form. You can
 * customize colours, spacing and fonts here to better match your theme. The
 * stylesheet is enqueued only when the [order-checkout] shortcode is present
 * on a single product page.
 */

.order-checkout-form {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-family: 'Tiro Bangla', sans-serif;
}

#variations-container {
    margin: 20px 0;
}

#variations-wrapper {
    margin-top: 15px;
}

.variation-set {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.variation-set:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
}

.variation-set:last-child {
    margin-bottom: 0;
}

/* Row layout for variation set - single row */
.variation-set-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-width: 0;
}

/* Column 1: Item number */
.variation-col-number {
    flex-shrink: 0;
    width: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Item number badge */
.item-number-badge {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #0073aa 0%, #005c90 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Tiro Bangla', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

/* Column 2: Dropdowns inline - all in one row */
.variation-col-dropdowns {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: 0;
}

/* Inline picker wrapper - keeps dropdowns in same row */
.variation-picker-wrapper-inline {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 150px;
    max-width: 180px;
}

.variation-picker-select-inline {
    width: 100%;
    min-width: 150px;
    max-width: 180px;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #ffffff;
    font-size: 15px;
    font-family: 'Tiro Bangla', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.variation-picker-select-inline:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.variation-picker-select-inline:hover {
    border-color: #0073aa;
}

.variation-picker-select-inline.error {
    border-color: #dc3545;
    background-color: #fff5f5;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.variation-picker-select-inline.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.variation-picker-select-inline option {
    padding: 10px;
    font-family: 'Tiro Bangla', sans-serif;
}

.variation-error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 10px;
    font-family: 'Tiro Bangla', sans-serif;
    padding: 10px;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
}

.order-checkout-form input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.variation-picker-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    font-family: 'Tiro Bangla', sans-serif;
}

.variation-picker-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #ffffff;
    font-size: 15px;
    font-family: 'Tiro Bangla', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
}

.variation-picker-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.variation-picker-select:hover {
    border-color: #0073aa;
}

.variation-picker-select option {
    padding: 10px;
    font-family: 'Tiro Bangla', sans-serif;
}


/* Form rows */
.order-checkout-form .form-row {
    margin-bottom: 20px;
}

.order-checkout-form .form-row:last-child {
    margin-bottom: 0;
}

.order-checkout-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    font-family: 'Tiro Bangla', sans-serif;
}

.order-checkout-form .required {
    color: #dc3545;
    font-weight: 700;
    margin-left: 3px;
}

.order-checkout-form .input-text,
.order-checkout-form .input-select,
.order-checkout-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    font-family: 'Tiro Bangla', sans-serif;
    font-size: 15px;
    transition: all 0.2s ease;
}

.order-checkout-form .input-text:focus,
.order-checkout-form .input-select:focus,
.order-checkout-form textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.order-checkout-form .input-text:hover,
.order-checkout-form .input-select:hover,
.order-checkout-form textarea:hover {
    border-color: #0073aa;
}

.order-checkout-form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Quantity input special styling */
.order-checkout-form input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
    font-family: 'Tiro Bangla', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.order-checkout-form input[type="number"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Submit button */
.order-checkout-form button.button {
    background: linear-gradient(135deg, #0073aa 0%, #005c90 100%);
    color: #fff;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    font-family: 'Tiro Bangla', sans-serif;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 115, 170, 0.2);
}

.order-checkout-form button.button:hover {
    background: linear-gradient(135deg, #005c90 0%, #004a73 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 115, 170, 0.3);
}

.order-checkout-form button.button:active {
    transform: translateY(0);
}

/* WooCommerce message styling override for success/error messages */
.woocommerce-message {
    margin-bottom: 25px;
    padding: 15px 20px;
    border: 2px solid #c3d6c6;
    background: linear-gradient(135deg, #f0f8f3 0%, #e8f5ed 100%);
    color: #2c662d;
    border-radius: 8px;
    font-family: 'Tiro Bangla', sans-serif;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(44, 102, 45, 0.1);
}

.woocommerce-error {
    margin-bottom: 25px;
    padding: 15px 20px;
    border: 2px solid #e0b4b4;
    background: linear-gradient(135deg, #fdf4f4 0%, #fce8e8 100%);
    color: #912d2b;
    border-radius: 8px;
    font-family: 'Tiro Bangla', sans-serif;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(145, 45, 43, 0.1);
}

/* Thank you page container styling */
.order-thank-you {
    font-family: 'Tiro Bangla', sans-serif;
    max-width: 700px;
    margin: 20px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Call button styling */
.order-checkout-call-button {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #fff;
    border: 2px solid #1e7e34;
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    text-decoration: none;
    font-family: 'Tiro Bangla', sans-serif;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-top: 15px;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2);
}

.order-checkout-call-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
}

.order-checkout-call-button:active {
    transform: translateY(0);
}

.order-checkout-call-button .call-text {
    display: block;
    margin-bottom: 5px;
    font-size: 18px;
}

.order-checkout-call-button .call-number {
    display: block;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive design */
@media (max-width: 768px) {
    .order-checkout-form {
        margin: 20px 15px;
        padding: 20px;
    }
    
    .variation-set {
        padding: 12px;
    }
    
    .variation-set-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .variation-col-number {
        width: auto;
    }
    
    .item-number-badge {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .variation-col-dropdowns {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }
    
    .variation-picker-wrapper-inline {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .variation-picker-select-inline {
        width: 100%;
        padding: 10px 12px;
        padding-right: 35px;
        font-size: 14px;
    }
}

/* Animation for showing variation sets */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.variation-set {
    animation: fadeInUp 0.3s ease-out;
}

/* Loading state */
.order-checkout-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.order-checkout-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Technical error notice with WhatsApp link */
.ocs-technical-error-notice {
    margin-bottom: 25px;
    padding: 20px;
    border: 2px solid #e0b4b4;
    background: linear-gradient(135deg, #fdf4f4 0%, #fce8e8 100%);
    color: #912d2b;
    border-radius: 8px;
    font-family: 'Tiro Bangla', sans-serif;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(145, 45, 43, 0.1);
}

.ocs-technical-error-notice p {
    margin: 0 0 15px 0;
}

.ocs-technical-error-notice p:last-child {
    margin-bottom: 0;
}

.ocs-technical-error-notice a {
    color: #25D366;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    padding: 10px 20px;
    background: #25D366;
    color: #fff !important;
    border-radius: 5px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.ocs-technical-error-notice a:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
    text-decoration: none;
}
