/* Creet Custom Orders — Frontend Styles (Arabic-only, RTL, mobile-first) */
/* Accent color is injected as --creet-co-accent (store primary) via wp_add_inline_style */

.creet-co-form-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

/* ── Product Header (shown on product pages) ── */
.creet-co-product-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #000 0%, #1a1a2e 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.creet-co-product-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(var(--creet-co-accent-rgb), 0.35);
    flex-shrink: 0;
}
.creet-co-product-thumb-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #1a1a2e;
    border: 2px solid rgba(var(--creet-co-accent-rgb), 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #64748b;
}
.creet-co-product-info {
    flex: 1;
    min-width: 0;
}
.creet-co-product-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--creet-co-accent);
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.creet-co-product-price {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

/* ── Form Title ── */
.creet-co-form-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}
.creet-co-form-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px;
}

/* ── Form Groups ── */
.creet-co-form-group {
    margin-bottom: 18px;
}
.creet-co-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.creet-co-req {
    color: #ef4444;
    margin-right: 2px;
}
.creet-co-form-group input[type="text"],
.creet-co-form-group input[type="email"],
.creet-co-form-group input[type="tel"],
.creet-co-form-group input[type="number"],
.creet-co-form-group select,
.creet-co-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #f8fafc;
    color: #0f172a;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    font-family: inherit;
}
.creet-co-form-group input:focus,
.creet-co-form-group select:focus,
.creet-co-form-group textarea:focus {
    outline: none;
    border-color: var(--creet-co-accent);
    box-shadow: 0 0 0 3px rgba(var(--creet-co-accent-rgb), 0.18);
    background: #fff;
}
.creet-co-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ── Form Row (side by side on desktop) ── */
.creet-co-form-row {
    display: flex;
    flex-direction: column;
    gap: 0;
}
@media (min-width: 600px) {
    .creet-co-form-row {
        flex-direction: row;
        gap: 14px;
    }
    .creet-co-form-row .creet-co-form-group {
        flex: 1;
    }
}

/* ── Phone Row ── */
.creet-co-phone-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.creet-co-phone-input {
    flex: 1;
    min-width: 0;
}
.creet-co-code-select {
    width: 120px !important;
    flex-shrink: 0;
    text-align: center;
}
.creet-co-field-hint {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ── Color Opt-In ── */
.creet-co-color-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    margin-bottom: 10px;
}
.creet-co-color-opt input[type="checkbox"] {
    display: none;
}
.creet-co-color-check-box {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    background: #fff;
    color: #fff;
}
.creet-co-color-opt input:checked + .creet-co-color-check-box {
    background: var(--creet-co-accent);
    border-color: var(--creet-co-accent);
    color: #000;
}
.creet-co-color-opt input:checked + .creet-co-color-check-box svg {
    opacity: 1;
}
.creet-co-color-check-box svg {
    opacity: 0;
    transition: opacity 0.2s;
}
.creet-co-color-opt-label {
    font-size: 13px;
    color: #64748b;
}
.creet-co-color-picker-box {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
}
.creet-co-color-picker-box.creet-co-color-active {
    display: flex;
}
.creet-co-color-picker-box input[type="color"] {
    width: 44px;
    height: 44px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 2px;
    cursor: pointer;
    background: transparent;
}
.creet-co-color-preview {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
    direction: ltr;
}

/* ── Dropzone ── */
.creet-co-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}
.creet-co-dropzone:hover,
.creet-co-dropzone.creet-co-dragover {
    border-color: var(--creet-co-accent);
    background: rgba(var(--creet-co-accent-rgb), 0.05);
}
.creet-co-dropzone svg {
    color: #94a3b8;
    margin-bottom: 8px;
}
.creet-co-dropzone p {
    font-size: 14px;
    color: #475569;
    margin: 0 0 4px;
}
.creet-co-dropzone small {
    font-size: 12px;
    color: #94a3b8;
}
.creet-co-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.creet-co-upload-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 10px;
}

/* ── File Previews ── */
.creet-co-file-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}
.creet-co-file-preview {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
}
.creet-co-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.creet-co-file-preview-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
}
.creet-co-file-remove {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* ── Submit Button ── */
.creet-co-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: var(--creet-co-accent);
    color: #fff;
    border: 2px solid var(--creet-co-accent);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    font-family: inherit;
    margin-top: 8px;
}
.creet-co-submit-btn:hover {
    opacity: 0.88;
    color: #fff;
}
.creet-co-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.creet-co-submit-btn svg {
    flex-shrink: 0;
}

/* ── Messages ── */
.creet-co-form-message {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}
.creet-co-form-message.success {
    background: rgba(var(--creet-co-accent-rgb), 0.1);
    color: #0f172a;
    border: 2px solid var(--creet-co-accent);
}
.creet-co-form-message.error {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #fecaca;
}

/* ── Spinner ── */
@keyframes creet-co-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.creet-co-spinner {
    animation: creet-co-spin 1s linear infinite;
}
