/*
 * styles.css
 * Estilos frontend — Pochytec Servicios por Zona
 * Compatible con Elementor y temas estándar de WordPress/WooCommerce.
 */

/* ─── Variables ────────────────────────────────────────────────────────────── */
:root {
    --pch-primary:        #0062cc;
    --pch-primary-hover:  #004fa3;
    --pch-secondary:      #6c757d;
    --pch-secondary-hover:#545b62;
    --pch-success:        #28a745;
    --pch-error:          #dc3545;
    --pch-warning-bg:     #fff3cd;
    --pch-warning-border: #ffc107;
    --pch-white:          #ffffff;
    --pch-overlay-bg:     rgba(0, 0, 0, 0.55);
    --pch-popup-bg:       #ffffff;
    --pch-popup-radius:   12px;
    --pch-popup-shadow:   0 10px 40px rgba(0, 0, 0, 0.18);
    --pch-popup-max-w:    480px;
    --pch-bar-bg:         #f0f4f8;
    --pch-bar-border:     #d1dbe8;
    --pch-font:           inherit;
    --pch-transition:     0.2s ease;
}

/* ─── Barra de zona superior ─────────────────────────────────────────────────*/
#pochytec-zone-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--pch-bar-bg);
    border-bottom: 1px solid var(--pch-bar-border);
    font-family: var(--pch-font);
    font-size: 0.875rem;
    flex-wrap: wrap;
    z-index: 9000;
    position: relative;
}

#pochytec-zone-bar.pochytec-zone-bar--empty {
    background: var(--pch-warning-bg);
    border-bottom-color: var(--pch-warning-border);
}

.pochytec-zone-bar__label {
    margin: 0;
    flex: 1 1 auto;
}

.pochytec-zone-bar__change,
.pochytec-zone-bar__select {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    cursor: pointer;
    color: var(--pch-primary);
    text-decoration: underline;
    font-family: inherit;
}

.pochytec-zone-bar__change:hover,
.pochytec-zone-bar__select:hover {
    color: var(--pch-primary-hover);
}

/* ─── Aviso en tienda ────────────────────────────────────────────────────────*/
.pochytec-notice {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 1.5em;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.pochytec-notice--warning {
    background: var(--pch-warning-bg);
    border: 1px solid var(--pch-warning-border);
}

/* ─── Overlay / fondo oscuro ─────────────────────────────────────────────────*/
.pochytec-overlay {
    position: fixed;
    inset: 0;
    background: var(--pch-overlay-bg);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

/* Bloquear scroll al abrir popup */
body.pochytec-popup-open {
    overflow: hidden;
}

/* ─── Popup card ─────────────────────────────────────────────────────────────*/
.pochytec-popup {
    position: relative;
    background: var(--pch-popup-bg);
    border-radius: var(--pch-popup-radius);
    box-shadow: var(--pch-popup-shadow);
    width: 100%;
    max-width: var(--pch-popup-max-w);
    max-height: 90vh;
    overflow-y: auto;
    font-family: var(--pch-font);
    animation: pochytecSlideIn var(--pch-transition);
}

@keyframes pochytecSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* Botón cerrar */
.pochytec-popup__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    transition: color var(--pch-transition);
    z-index: 1;
}

.pochytec-popup__close:hover {
    color: #111;
}

/* Header del popup */
.pochytec-popup__header {
    text-align: center;
    padding: 32px 32px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.pochytec-popup__icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.pochytec-popup__title {
    margin: 0 0 8px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a1a;
}

.pochytec-popup__subtitle {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Body del popup */
.pochytec-popup__body {
    padding: 24px 32px 28px;
}

/* Zona actual (indicador) */
.pochytec-popup__current {
    text-align: center;
    margin: 12px 0 0;
    font-size: 0.85rem;
    color: #888;
}

/* ─── Campos de formulario ───────────────────────────────────────────────────*/
.pochytec-popup__field {
    margin-bottom: 18px;
}

.pochytec-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.pochytec-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px;
    border: 1.5px solid #ccc;
    border-radius: 8px;
    padding: 10px 38px 10px 12px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #333;
    cursor: pointer;
    transition: border-color var(--pch-transition), box-shadow var(--pch-transition);
    box-sizing: border-box;
}

.pochytec-select--full {
    width: 100%;
}

.pochytec-select:focus {
    outline: none;
    border-color: var(--pch-primary);
    box-shadow: 0 0 0 3px rgba(0, 98, 204, 0.15);
}

/* ─── Botones ─────────────────────────────────────────────────────────────── */
.pochytec-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
}

.pochytec-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--pch-transition), transform 0.1s ease;
    text-decoration: none;
}

.pochytec-btn:active {
    transform: scale(0.98);
}

.pochytec-btn--primary {
    background: var(--pch-primary);
    color: var(--pch-white);
}

.pochytec-btn--primary:hover:not(:disabled) {
    background: var(--pch-primary-hover);
}

.pochytec-btn--primary:disabled {
    background: #93b8e0;
    cursor: not-allowed;
}

.pochytec-btn--secondary {
    background: #f0f0f0;
    color: #333;
}

.pochytec-btn--secondary:hover {
    background: #e0e0e0;
}

.pochytec-btn--block {
    width: 100%;
}

.pochytec-btn--sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.pochytec-btn--link {
    background: none;
    color: var(--pch-primary);
    text-decoration: underline;
    padding: 0;
    font-weight: normal;
}

/* ─── Mensajes ────────────────────────────────────────────────────────────── */
.pochytec-message {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-top: 12px;
    margin-bottom: 0;
}

.pochytec-message--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.pochytec-message--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.pochytec-message--info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ─── Selector inline (shortcode) ────────────────────────────────────────── */
.pochytec-zone-selector--inline {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    padding: 20px;
    max-width: 500px;
    font-family: var(--pch-font);
}

.pochytec-zone-selector__label {
    font-weight: 600;
    margin: 0 0 12px;
    color: #333;
}

.pochytec-zone-selector__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}

.pochytec-zone-selector__fields .pochytec-select {
    flex: 1 1 180px;
}

.pochytec-current-zone-msg {
    margin: 0 0 12px;
    color: #555;
    font-size: 0.9rem;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .pochytec-popup__header {
        padding: 24px 20px 14px;
    }

    .pochytec-popup__body {
        padding: 18px 20px 22px;
    }

    .pochytec-popup__title {
        font-size: 1.15rem;
    }

    .pochytec-zone-selector__fields {
        flex-direction: column;
    }

    .pochytec-zone-selector__fields .pochytec-btn {
        width: 100%;
    }
}
