/* ============================================================
   WP Comercios Locales — Estilos Públicos
   ============================================================ */

/* ----- Variables de color ----- */
:root {
    --wpcl-primary:    #2271b1;
    --wpcl-primary-dk: #135e96;
    --wpcl-green:      #00a32a;
    --wpcl-red:        #d63638;
    --wpcl-wa:         #25d366;
    --wpcl-gray:       #50575e;
    --wpcl-light:      #f6f7f7;
    --wpcl-border:     #dcdcde;
    --wpcl-radius:     10px;
    --wpcl-shadow:     0 2px 8px rgba(0,0,0,.10);
}

/* ----- Filtros ----- */
.wpcl-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
    align-items: center;
}
.wpcl-filtros input[type="search"],
.wpcl-filtros select {
    padding: 8px 12px;
    border: 1px solid var(--wpcl-border);
    border-radius: 6px;
    font-size: .95rem;
    background: #fff;
    min-width: 180px;
}
.wpcl-filtros input[type="search"]:focus,
.wpcl-filtros select:focus {
    outline: none;
    border-color: var(--wpcl-primary);
    box-shadow: 0 0 0 2px rgba(34,113,177,.18);
}
.wpcl-label-abierto {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    cursor: pointer;
    color: var(--wpcl-gray);
}

/* ----- Grilla ----- */
.wpcl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* ----- Tarjeta ----- */
.wpcl-card {
    background: #fff;
    border: 1px solid var(--wpcl-border);
    border-radius: var(--wpcl-radius);
    box-shadow: var(--wpcl-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
}
.wpcl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.13);
}
.wpcl-card[hidden] { display: none !important; }

/* Header de la tarjeta */
.wpcl-card-header {
    position: relative;
    background: var(--wpcl-light);
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.wpcl-card-img img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}
.wpcl-no-img {
    color: #bbb;
}
.wpcl-no-img .dashicons {
    font-size: 52px;
    width: 52px;
    height: 52px;
}

/* Badge abierto/cerrado */
.wpcl-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.wpcl-badge-abierto { background: var(--wpcl-green); color: #fff; }
.wpcl-badge-cerrado { background: #999; color: #fff; }

/* Cuerpo */
.wpcl-card-body {
    padding: 14px 16px;
    flex: 1;
}
.wpcl-card-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
}
.wpcl-card-title a {
    color: inherit;
    text-decoration: none;
}
.wpcl-card-title a:hover { color: var(--wpcl-primary); }

.wpcl-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}
.wpcl-tag {
    background: var(--wpcl-light);
    border: 1px solid var(--wpcl-border);
    border-radius: 20px;
    padding: 2px 9px;
    font-size: .78rem;
    color: var(--wpcl-gray);
}

.wpcl-card-loc,
.wpcl-card-direccion {
    margin: 4px 0;
    font-size: .85rem;
    color: var(--wpcl-gray);
    display: flex;
    align-items: center;
    gap: 4px;
}
.wpcl-card-loc .dashicons,
.wpcl-card-direccion .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--wpcl-primary);
}

/* Footer */
.wpcl-card-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--wpcl-border);
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* Botones */
.wpcl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
    cursor: pointer;
    border: none;
}
.wpcl-btn .dashicons { font-size: 16px; width: 16px; height: 16px; }

.wpcl-btn-tel   { background: var(--wpcl-primary); color: #fff; }
.wpcl-btn-tel:hover { background: var(--wpcl-primary-dk); color: #fff; }

.wpcl-btn-wa    { background: var(--wpcl-wa); color: #fff; }
.wpcl-btn-wa:hover { background: #1ebe57; color: #fff; }

.wpcl-btn-email { background: #f0f0f1; color: var(--wpcl-gray); }
.wpcl-btn-email:hover { background: #e0e0e0; }

.wpcl-btn-web   { background: #f0f0f1; color: var(--wpcl-gray); }
.wpcl-btn-web:hover { background: #e0e0e0; }

.wpcl-btn-fb    { background: #1877F2; color: #fff; }
.wpcl-btn-fb:hover { background: #0e62cc; color: #fff; }

.wpcl-btn-ig    { background: #e1306c; color: #fff; }
.wpcl-btn-ig:hover { background: #c01555; color: #fff; }

.wpcl-btn-ver   { background: var(--wpcl-primary); color: #fff; margin-left: auto; }
.wpcl-btn-ver:hover { background: var(--wpcl-primary-dk); color: #fff; }

/* Mensaje sin resultados */
.wpcl-sin-resultados, .wpcl-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--wpcl-gray);
    padding: 30px;
    background: var(--wpcl-light);
    border-radius: var(--wpcl-radius);
}

/* ----- Widget Farmacia de Turno ----- */
.wpcl-farmacia-turno-widget {
    background: #fff;
    border: 2px solid var(--wpcl-primary);
    border-radius: var(--wpcl-radius);
    padding: 20px 24px;
    max-width: 520px;
}
.wpcl-ft-titulo {
    margin: 0 0 16px;
    color: var(--wpcl-primary);
    font-size: 1.2rem;
}
.wpcl-ft-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.wpcl-ft-img img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}
.wpcl-ft-info h4 { margin: 0 0 6px; font-size: 1.1rem; }
.wpcl-ft-info p  { margin: 4px 0; font-size: .9rem; color: var(--wpcl-gray); }
.wpcl-ft-botones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.wpcl-ft-24      { color: var(--wpcl-green); font-weight: 700; margin-top: 8px !important; }
.wpcl-ft-sin-turno { color: var(--wpcl-gray); font-style: italic; }

/* ----- Agenda de Turnos ----- */
.wpcl-agenda-wrapper { overflow-x: auto; }
.wpcl-agenda-titulo { margin: 0 0 16px; font-size: 1.2rem; color: var(--wpcl-primary); }
.wpcl-agenda-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.wpcl-agenda-table th,
.wpcl-agenda-table td {
    padding: 10px 14px;
    border: 1px solid var(--wpcl-border);
    text-align: left;
}
.wpcl-agenda-table thead th {
    background: var(--wpcl-light);
    font-weight: 700;
}
.wpcl-turno-hoy {
    background: #eaf4fb;
    font-weight: 600;
}
.wpcl-badge-hoy {
    display: inline-block;
    background: var(--wpcl-primary);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 4px;
    text-transform: uppercase;
}

/* ----- Responsive ----- */
@media (max-width: 600px) {
    .wpcl-grid { grid-template-columns: 1fr; }
    .wpcl-filtros { flex-direction: column; align-items: stretch; }
    .wpcl-filtros input, .wpcl-filtros select { min-width: 0; width: 100%; }
    .wpcl-ft-card { flex-direction: column; }
}
