:root {
    --rey-sa-primary: #2e7d32;
    --rey-sa-primary-dark: #245f27;
    --rey-sa-text: #1a1a1a;
    --rey-sa-muted: #6b7280;
    --rey-sa-border: #e5e7eb;
    --rey-sa-bg: #ffffff;
    --rey-sa-bg-soft: #f7f7f8;
    --rey-sa-radius: 10px;
    --rey-sa-error: #c0392b;
    --rey-sa-error-bg: #fdecea;
    --rey-sa-success-bg: #eafaf1;
}

/* Personaliza el color principal según tu marca, por ejemplo para El Rey de los Perfumes:
   .rey-sa-panel { --rey-sa-primary: #b8860b; --rey-sa-primary-dark: #8a6508; }
*/

.rey-sa-panel {
    max-width: 640px;
    margin: 0 auto;
    font-family: inherit;
    color: var(--rey-sa-text);
}

.rey-sa-card {
    background: var(--rey-sa-bg);
    border: 1px solid var(--rey-sa-border);
    border-radius: var(--rey-sa-radius);
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.rey-sa-title {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
}

.rey-sa-subtitle {
    margin: 0 0 24px;
    color: var(--rey-sa-muted);
}

.rey-sa-step-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
}

.rey-sa-step-num {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 50%;
    background: var(--rey-sa-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.rey-sa-step-head h3 {
    margin: 0;
    font-size: 17px;
}

.rey-sa-field {
    margin-bottom: 16px;
}

.rey-sa-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
}

.rey-sa-panel select,
.rey-sa-panel input[type="text"],
.rey-sa-panel input[type="email"],
.rey-sa-panel input[type="tel"],
.rey-sa-panel textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--rey-sa-border);
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    color: var(--rey-sa-text);
    box-sizing: border-box;
}

.rey-sa-panel select:focus,
.rey-sa-panel input:focus,
.rey-sa-panel textarea:focus {
    outline: none;
    border-color: var(--rey-sa-primary);
}

.rey-sa-panel textarea {
    min-height: 90px;
    resize: vertical;
}

.rey-sa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    transition: background .15s ease;
}

.rey-sa-btn-primary {
    background: var(--rey-sa-primary);
    color: #fff;
}

.rey-sa-btn-primary:hover:not(:disabled) {
    background: var(--rey-sa-primary-dark);
}

.rey-sa-btn-primary:disabled {
    background: #a9b0ad;
    cursor: not-allowed;
}

.rey-sa-btn-secondary {
    background: var(--rey-sa-bg-soft);
    color: var(--rey-sa-text);
    border: 1px solid var(--rey-sa-border);
}

.rey-sa-btn-secondary:hover {
    background: #eee;
}

.rey-sa-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.rey-sa-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid var(--rey-sa-border);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.rey-sa-tab.active {
    border-color: var(--rey-sa-primary);
    color: var(--rey-sa-primary);
    background: var(--rey-sa-bg-soft);
}

.rey-sa-order-card {
    border: 1px solid var(--rey-sa-border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.rey-sa-order-card:hover {
    border-color: var(--rey-sa-primary);
}

.rey-sa-order-card.selected {
    border-color: var(--rey-sa-primary);
    background: var(--rey-sa-bg-soft);
}

.rey-sa-order-card .rey-sa-order-meta {
    font-size: 13px;
    color: var(--rey-sa-muted);
}

.rey-sa-product-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--rey-sa-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
}

.rey-sa-product-card:hover {
    border-color: var(--rey-sa-primary);
}

.rey-sa-product-card.selected {
    border-color: var(--rey-sa-primary);
    background: var(--rey-sa-bg-soft);
}

.rey-sa-product-card img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex: 0 0 44px;
}

.rey-sa-product-card .rey-sa-product-name {
    font-weight: 600;
    font-size: 14px;
}

.rey-sa-product-card .rey-sa-product-qty {
    font-size: 12px;
    color: var(--rey-sa-muted);
}

.rey-sa-dropzone {
    border: 2px dashed var(--rey-sa-border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    color: var(--rey-sa-muted);
    font-size: 14px;
}

.rey-sa-dropzone.has-file {
    border-color: var(--rey-sa-primary);
    color: var(--rey-sa-text);
}

.rey-sa-dropzone input[type="file"] {
    display: none;
}

.rey-sa-preview {
    margin-top: 10px;
    max-width: 160px;
    border-radius: 8px;
    display: none;
}

.rey-sa-error {
    background: var(--rey-sa-error-bg);
    color: var(--rey-sa-error);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}

.rey-sa-success {
    background: var(--rey-sa-success-bg);
    color: #14532d;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.rey-sa-success h3 {
    margin: 0 0 8px;
}

.rey-sa-help-text {
    font-size: 13px;
    color: var(--rey-sa-muted);
    margin: -8px 0 16px;
}

.rey-sa-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rey-sa-spin .7s linear infinite;
}

@keyframes rey-sa-spin {
    to { transform: rotate(360deg); }
}

.rey-sa-loading-inline {
    color: var(--rey-sa-muted);
    font-size: 14px;
    padding: 10px 0;
}
