/* ============================================================
   Style variables
   These defaults match the plugin's original look exactly. The
   admin's saved choices (Settings -> Ρυθμίσεις -> 4. Εμφάνιση)
   are injected as a second :root{} block right after this file
   via wp_add_inline_style(), and simply override the ones below -
   so the form keeps looking correct even if that override is ever
   missing for any reason.
   ============================================================ */
:root {
    --wrm-primary-color: #0071a1;
    --wrm-primary-hover-color: #005a80;
    --wrm-success-color: #46b450;
    --wrm-success-hover-color: #389a41;
    --wrm-button-text-color: #ffffff;
    --wrm-heading-color: #1a202c;
    --wrm-bg-color: #ffffff;
    --wrm-radius: 8px;
}

/* Container wrapping both buttons */
.wrm-actions-container,
.wrm-form-actions {
    display: flex !important;
    align-items: center !important; /* Vertically aligns buttons along the center */
    justify-content: space-between; /* Keeps submit on left, back button on right */
    gap: 15px; /* Adds clean spacing if they ever touch */
}

/* Ensure both buttons reset baseline offsets */
.wrm-actions-container button,
.wrm-actions-container input[type="submit"],
.wrm-form-actions button,
.wrm-form-actions input[type="submit"] {
    margin: 0 !important; /* Removes default browser bottom/top margins */
    vertical-align: middle !important;
    box-sizing: border-box !important;
}
.wrm-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.wrm-form-actions .wrm-btn-secondary {
    white-space: nowrap;
    padding: 10px 20px;
}

.wrm-form-actions .wrm-btn-success {
    flex: 1;
}

/* Responsive adjustment for mobile screens */
@media (max-width: 480px) {
    .wrm-form-actions {
        flex-direction: column-reverse;
    }
    
    .wrm-form-actions button {
        width: 100%;
    }
}
.wrm-form-wrapper {
    background: var(--wrm-bg-color);
    border-radius: calc(var(--wrm-radius) + 4px);
    padding: 40px;
    margin: 40px auto;
    font-family: inherit;
    box-sizing: border-box;
}
/* Ensure the reason textarea expands full-width and matches standard inputs */
.wrm-reason-section textarea,
#wrm_reason {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: var(--wrm-radius); /* Matches rounded corners of inputs above */
    font-family: inherit;
    font-size: 15px;
    min-height: 110px;  /* Gives it a taller starting height */
    resize: vertical;   /* Allows users to drag-resize vertically if needed */
}

.wrm-form-wrapper *,
.wrm-form-wrapper *::before,
.wrm-form-wrapper *::after {
    box-sizing: border-box;
}

.wrm-form-title {
    margin-top: 0;
    font-size: 24px;
    color: var(--wrm-heading-color);
    font-weight: 700;
}

.wrm-form-subtitle {
    color: #718096;
    font-size: 14px;
    margin-bottom: 25px;
}

.wrm-field-group {
    margin-bottom: 15px;
}

.wrm-field-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--wrm-heading-color);
    font-size: 14px;
}

.wrm-field-group input[type="text"],
.wrm-field-group input[type="email"],
.wrm-field-group input[type="tel"],
.wrm-field-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: var(--wrm-radius);
    font-size: 15px;
    transition: border-color 0.2s;
}

.wrm-field-group input:focus,
.wrm-field-group textarea:focus {
    border-color: var(--wrm-primary-color);
    outline: none;
}

.wrm-btn-primary,
.wrm-btn-success {
    color: var(--wrm-button-text-color);
    padding: 10px 20px;
    border: none;
    border-radius: var(--wrm-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
}

.wrm-btn-primary {
    background: var(--wrm-primary-color);
}
.wrm-btn-primary:hover {
    background: var(--wrm-primary-hover-color);
}

.wrm-btn-success {
    background: var(--wrm-success-color);
    padding: 12px 25px;
    margin-top: 20px;
}
.wrm-btn-success:hover {
    background: var(--wrm-success-hover-color);
}

.wrm-btn-secondary {
    display: inline-block;
    background: transparent;
    color: #4a5568;
    padding: 8px 16px;
    border: 1px solid #cbd5e0;
    border-radius: var(--wrm-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 15px;
}
.wrm-btn-secondary:hover {
    background: #edf2f7;
    color: #2d3748;
}

.wrm-feedback-box {
    display: none;
    margin-top: 15px;
    padding: 10px 12px;
    border-radius: var(--wrm-radius);
    font-weight: 600;
    font-size: 14px;
}

.wrm-feedback-box.error {
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
}

.wrm-feedback-box.info {
    background: #ebf8ff;
    color: #2b6cb0;
    border: 1px solid #90cdf4;
}

.wrm-feedback-box.success {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #c6f6d5;
}

/* Success / error banner shown after redirect */
.wrm-message {
    padding: 15px;
    border-radius: var(--wrm-radius);
    margin: 0 auto 20px;
    max-width: 600px;
    font-weight: 600;
}
.wrm-message.success {
    background: #e6f4ea;
    color: #137333;
}
.wrm-message.error {
    background: #fce8e6;
    color: #c5221f;
}

.wrm-submit-form {
    display: none;
    margin-top: 25px;
}

.wrm-order-summary {
    background: #f9f9f9;
    padding: 12px;
    border-radius: var(--wrm-radius);
    margin-bottom: 15px;
    border-left: 4px solid var(--wrm-primary-color);
    font-size: 14px;
    color: #333;
}

.wrm-section-title {
    font-size: 18px;
    color: var(--wrm-heading-color);
    margin: 25px 0 15px;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 8px;
}

.wrm-products-grid {
    margin-bottom: 25px;
}

.wrm-product-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--wrm-radius);
    margin-bottom: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.wrm-product-card.is-returned {
    opacity: 0.6;
    background: #f4f4f4;
}

.wrm-product-checkbox {
    margin-right: 15px;
    transform: scale(1.2);
    cursor: pointer;
    flex-shrink: 0;
}

.wrm-product-card.is-returned .wrm-product-checkbox {
    cursor: not-allowed;
}

.wrm-product-img {
    margin-right: 15px;
    flex-shrink: 0;
}

.wrm-product-img img {
    border-radius: 6px;
    display: block;
}

.wrm-product-info {
    flex: 1;
    min-width: 0;
}

.wrm-product-title {
    display: block;
    font-weight: 700;
    color: var(--wrm-heading-color);
}

.wrm-product-meta {
    display: block;
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.wrm-already-returned-note {
    display: block;
    color: #dc3232;
    font-size: 11px;
    font-weight: 700;
    margin-top: 5px;
}

.wrm-customer-details-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.wrm-reason-section {
    margin-top: 20px;
}

.wrm-reason-section label {
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
    color: var(--wrm-heading-color);
}

/* ============================================================
   Quantity selector for partial returns
   ============================================================ */
.wrm-qty-selector {
    flex-shrink: 0;
    margin-left: 12px;
    text-align: center;
}

.wrm-qty-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.wrm-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #cbd5e0;
    border-radius: var(--wrm-radius);
    overflow: hidden;
}

.wrm-qty-btn {
    background: #f7fafc;
    border: none;
    color: #4a5568;
    font-size: 16px;
    font-weight: 700;
    width: 30px;
    cursor: pointer;
    transition: background 0.2s;
}

.wrm-qty-btn:hover:not(:disabled) {
    background: #edf2f7;
}

.wrm-qty-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.wrm-qty-btn.wrm-qty-minus {
    border-right: 1px solid #cbd5e0;
}

.wrm-qty-btn.wrm-qty-plus {
    border-left: 1px solid #cbd5e0;
}

.wrm-qty-input {
    width: 42px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    -moz-appearance: textfield;
    padding: 0 4px;
}

.wrm-qty-input:disabled {
    background: #fff;
    color: #a0aec0;
    cursor: not-allowed;
}

.wrm-qty-input::-webkit-outer-spin-button,
.wrm-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wrm-partial-returned-note {
    display: block;
    color: #b7791f;
    font-size: 11px;
    font-weight: 700;
    margin-top: 5px;
}

@media (max-width: 480px) {
    .wrm-product-card {
        flex-wrap: wrap;
    }

    .wrm-qty-selector {
        margin-left: 0;
        margin-top: 12px;
        width: 100%;
        text-align: left;
    }
}
