/* =============================================================
   Wollo Tienda — Estilos del panel
   Namespace: .wt-*
   Construido sobre los tokens compartidos --wollo-* de panel-koia
   (wollo-design-system.css), incluyendo el override de color por
   vertical (body.pkoi-sitio-tienda), mismo patrón que
   wollo-fundacion/recursos/css/fundacion.css.
   ============================================================= */

.pkoi-pagina-contenido {
    font-family: var(--wollo-font);
}

body.pkoi-sitio-tienda .content-wrapper {
    padding: 32px 24px 100px 24px;
}
body.pkoi-sitio-tienda .content-wrapper > .pkoi-pagina-contenido {
    margin: -32px -24px -100px -24px;
}
@media (max-width: 768px) {
    body.pkoi-sitio-tienda .content-wrapper {
        padding: 20px 16px 100px 16px;
    }
    body.pkoi-sitio-tienda .content-wrapper > .pkoi-pagina-contenido {
        margin: -20px -16px -100px -16px;
    }
}

/* =============================================================
   UTILIDADES
   ============================================================= */

.wt-text-muted { color: var(--wollo-text-muted); }
.wt-text-sm    { font-size: var(--wollo-font-size-sm); }
.wt-mb-4 { margin-bottom: 16px; }
.wt-mt-2 { margin-top: 8px; }
.wt-error { color: var(--wollo-error-dark); font-weight: 600; padding: 16px; }

.wt-estado-bloqueo {
    max-width: 600px;
    margin: 60px auto;
    text-align: center;
    background: var(--wollo-bg-white);
    border: 1px solid var(--wollo-border);
    border-radius: var(--wollo-radius-xl);
    padding: 40px;
}
.wt-estado-bloqueo h2 { margin: 0 0 12px; font-weight: 900; color: var(--wollo-text-darkest); }
.wt-estado-bloqueo p { color: var(--wollo-text-muted); margin: 0; }
.wt-estado-bloqueo--error h2 { color: var(--wollo-error-dark); }

/* =============================================================
   HEADER DE PÁGINA
   ============================================================= */

.wt-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.wt-page-header-left h2 {
    font-size: var(--wollo-font-size-2xl);
    font-weight: 800;
    color: var(--wollo-text-darkest);
    margin: 0;
    letter-spacing: -0.3px;
}

.wt-page-header-left p {
    color: var(--wollo-text-muted);
    margin: 5px 0 0;
    font-size: var(--wollo-font-size-md);
}

/* =============================================================
   TARJETAS KPI (Mi Día)
   ============================================================= */

.wt-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.wt-kpi {
    background: var(--wollo-bg-white);
    border: 1px solid var(--wollo-border);
    border-radius: var(--wollo-radius-lg);
    padding: 20px 24px;
    box-shadow: var(--wollo-shadow-sm);
    transition: var(--wollo-transition-md);
    display: flex;
    align-items: center;
    gap: 16px;
}
.wt-kpi:hover { transform: translateY(-3px); box-shadow: var(--wollo-shadow-md); }

.wt-kpi__icon {
    width: 50px;
    height: 50px;
    border-radius: var(--wollo-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    background: var(--wollo-primary-light);
    color: var(--wollo-primary);
}
.wt-kpi__icon--success { background: var(--wollo-success-light); color: var(--wollo-success-dark); }
.wt-kpi__icon--info    { background: var(--wollo-info-light);    color: var(--wollo-info-dark); }

.wt-kpi__valor {
    font-size: 2rem;
    font-weight: 900;
    color: var(--wollo-text-darkest);
    line-height: 1.1;
    margin: 0;
}
.wt-kpi__label {
    margin: 0;
    color: var(--wollo-text-muted);
    font-size: var(--wollo-font-size-sm);
    font-weight: 600;
}

/* =============================================================
   MI DÍA — SALUDO + ACCESOS RÁPIDOS
   ============================================================= */

.wt-midis-wrap { display: flex; flex-direction: column; gap: 8px; }
.wt-midis-saludo h1 { font-size: var(--wollo-font-size-2xl); font-weight: 800; color: var(--wollo-text-darkest); margin: 0 0 4px; }
.wt-midis-saludo p  { color: var(--wollo-text-muted); margin: 0 0 24px; }

.wt-accesos-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =============================================================
   TABS
   ============================================================= */

.wt-tabs-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--wollo-border-light);
    margin-bottom: 25px;
}

.wt-tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-size: var(--wollo-font-size-base);
    font-weight: 700;
    color: var(--wollo-text-muted);
    cursor: pointer;
    border-radius: var(--wollo-radius-sm);
    transition: var(--wollo-transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}
.wt-tab-btn:hover { background-color: var(--wollo-bg-soft); color: var(--wollo-text-dark); }
.wt-tab-btn.active {
    background-color: var(--wollo-bg-white);
    color: var(--wollo-primary);
    border-bottom: 3px solid var(--wollo-primary);
    box-shadow: var(--wollo-shadow-sm);
}

.wt-tab-count {
    background: var(--wollo-bg-soft);
    color: var(--wollo-text-muted);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.wt-tab-content { display: none; animation: wollo-fade-in-up 0.4s ease-out; }
.wt-tab-content.active { display: block; }

/* =============================================================
   BUSCADOR
   ============================================================= */

.wt-search-bar { position: relative; max-width: 300px; width: 100%; }
.wt-search-bar input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border: 1.5px solid var(--wollo-border);
    border-radius: var(--wollo-radius-full);
    background: var(--wollo-bg-white);
    font-family: var(--wollo-font);
    transition: var(--wollo-transition);
}
.wt-search-bar input:focus {
    outline: none;
    border-color: var(--wollo-primary);
    box-shadow: 0 0 0 4px var(--wollo-primary-light);
}
.wt-search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wollo-text-light);
}

/* =============================================================
   GRID DE PRODUCTOS (Mis Productos)
   ============================================================= */

.wt-pets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.wt-pet-card {
    background: var(--wollo-bg-white);
    border-radius: var(--wollo-radius-xl);
    overflow: hidden;
    box-shadow: var(--wollo-shadow-sm);
    transition: var(--wollo-transition-md);
    border: 1px solid var(--wollo-border-light);
    display: flex;
    flex-direction: column;
}
.wt-pet-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--wollo-shadow-lg);
    border-color: var(--wollo-primary-border);
}

.wt-pet-card__image {
    height: 200px;
    width: 100%;
    position: relative;
    overflow: hidden;
    background-color: var(--wollo-bg-soft);
}
.wt-pet-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.wt-pet-card:hover .wt-pet-card__image img { transform: scale(1.05); }

.wt-pet-card__body { padding: 18px; flex-grow: 1; display: flex; flex-direction: column; }

.wt-pet-card__name {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--wollo-text-darkest);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wt-pet-card__breed { font-size: var(--wollo-font-size-sm); color: var(--wollo-text-muted); margin-bottom: 14px; display: block; }

.wt-pet-card__stats { display: flex; gap: 10px; margin-bottom: 18px; font-size: var(--wollo-font-size-xs); color: var(--wollo-text); flex-wrap: wrap; }
.wt-pet-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--wollo-bg-soft);
    padding: 5px 10px;
    border-radius: var(--wollo-radius-sm);
}
.wt-pet-stat-item i { color: var(--wollo-primary); }

.wt-pet-card__actions { margin-top: auto; display: flex; gap: 10px; }

.wt-empty-state-tab {
    text-align: center;
    padding: 40px;
    color: var(--wollo-text-light);
    background: var(--wollo-bg-soft);
    border-radius: var(--wollo-radius-lg);
    border: 2px dashed var(--wollo-border);
}

/* =============================================================
   FORMULARIO (Registrar / Editar Producto)
   ============================================================= */

.wt-form-container { max-width: 900px; margin: 0 auto; }

.wt-form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.wt-form-header h2 { font-size: var(--wollo-font-size-2xl); color: var(--wollo-text-darkest); font-weight: 800; margin: 0; }
.wt-form-header p  { color: var(--wollo-text-muted); margin: 0.2rem 0 0 0; }

.wt-form-section-card {
    background: var(--wollo-bg-white);
    border-radius: var(--wollo-radius-xl);
    padding: 1.75rem;
    box-shadow: var(--wollo-shadow-sm);
    margin-bottom: 1.5rem;
    border: 1px solid var(--wollo-border-light);
}

.wt-section-title {
    font-size: var(--wollo-font-size-md);
    font-weight: 800;
    color: var(--wollo-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.wt-section-title i { background: var(--wollo-primary-light); padding: 8px; border-radius: var(--wollo-radius-sm); }

.wt-form-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
/* auto-fit en vez de un breakpoint fijo de viewport: así se adapta al ancho
   real del contenedor (por ejemplo cuando está junto a un sidebar), no solo
   al ancho de la pantalla. */
.wt-form-grid-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.wt-form-grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.wt-input-group label { display: block; font-weight: 700; font-size: var(--wollo-font-size-sm); color: var(--wollo-text); margin-bottom: 0.4rem; }

/* Compartidas por cualquier formulario del panel (Mi Negocio, Legal, etc.) —
   auto-fit en vez de un breakpoint fijo, para que se adapten al ancho real
   del contenedor y no solo al ancho de la pantalla. */
.wt-field { margin-bottom: 18px; }
.wt-label { display: block; font-size: var(--wollo-font-size-xs); font-weight: 800; color: var(--wollo-text-dark); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.wt-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }

.wt-input, .wt-select, .wt-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--wollo-border);
    border-radius: var(--wollo-radius-md);
    font-family: var(--wollo-font);
    font-size: var(--wollo-font-size-base);
    color: var(--wollo-text-darkest);
    background: var(--wollo-bg);
    transition: var(--wollo-transition);
    box-sizing: border-box;
}
.wt-input:focus, .wt-select:focus, .wt-textarea:focus {
    outline: none;
    border-color: var(--wollo-primary);
    background: var(--wollo-bg-white);
    box-shadow: 0 0 0 4px var(--wollo-primary-light);
}
.wt-textarea { resize: vertical; min-height: 100px; }

.wt-upload-zone-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.wt-upload-zone {
    width: 100%;
    height: 260px;
    border: 3px dashed var(--wollo-border);
    border-radius: var(--wollo-radius-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: var(--wollo-bg);
    transition: var(--wollo-transition-md);
    position: relative;
    overflow: hidden;
}
.wt-upload-zone:hover,
.wt-upload-zone.dragover { border-color: var(--wollo-primary); background-color: var(--wollo-primary-light); }
.wt-upload-zone input[type="file"] { position: absolute; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; }

.wt-upload-content { text-align: center; color: var(--wollo-text-muted); pointer-events: none; }
.wt-upload-icon-circle {
    width: 56px; height: 56px;
    background: var(--wollo-bg-soft);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 14px;
    font-size: 22px;
    color: var(--wollo-text-muted);
}

.wt-preview-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; background: var(--wollo-bg-white); z-index: 5;
}
.wt-preview-container.has-image { display: flex; align-items: center; justify-content: center; }
.wt-preview-container img { width: 100%; height: 100%; object-fit: cover; }

.wt-remove-image-btn {
    position: absolute; bottom: 15px; right: 15px;
    background: rgba(0,0,0,0.65); color: #fff;
    border: none; border-radius: 50%;
    width: 38px; height: 38px;
    cursor: pointer; z-index: 20;
    display: none; align-items: center; justify-content: center;
    transition: var(--wollo-transition);
}
.wt-preview-container.has-image ~ .wt-remove-image-btn { display: flex; }
.wt-remove-image-btn:hover { background: var(--wollo-error); }

.wt-form-actions { display: flex; justify-content: flex-end; gap: 14px; margin-top: 18px; }

/* =============================================================
   BOTONES
   ============================================================= */

.wt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--wollo-radius-md);
    font-family: var(--wollo-font);
    font-weight: 700;
    font-size: var(--wollo-font-size-base);
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--wollo-transition);
    white-space: nowrap;
}
.wt-btn--primario { background: var(--wollo-primary); color: #fff; box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25); }
.wt-btn--primario:hover { background: var(--wollo-primary-hover); transform: translateY(-2px); }
.wt-btn--primario:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.wt-btn--secondary {
    background: var(--wollo-bg-white);
    color: var(--wollo-text-dark);
    border: 1.5px solid var(--wollo-border);
}
.wt-btn--secondary:hover { background: var(--wollo-bg-soft); }

.wt-btn--danger-outline {
    background: #fff;
    color: var(--wollo-error);
    border: 2px solid var(--wollo-error-border);
}
.wt-btn--danger-outline:hover { background: var(--wollo-error-light); border-color: var(--wollo-error); }

.wt-btn--sm { padding: 8px 14px; font-size: var(--wollo-font-size-xs); border-radius: var(--wollo-radius-sm); }
.wt-btn--block { width: 100%; }

/* =============================================================
   FEEDBACK / ALERTAS
   ============================================================= */

.wt-feedback {
    padding: 14px;
    border-radius: var(--wollo-radius-md);
    margin-top: 15px;
    display: none;
    text-align: center;
    font-weight: 700;
}
.wt-feedback.success { background: var(--wollo-success-light); color: var(--wollo-success-dark); display: block; }
.wt-feedback.error   { background: var(--wollo-error-light);   color: var(--wollo-error-dark);   display: block; }

/* =============================================================
   RESPONSIVE
   ============================================================= */

@media (max-width: 768px) {
    .wt-page-header { flex-direction: column; align-items: flex-start; }
    .wt-kpi-grid { grid-template-columns: 1fr; }
    .wt-pets-grid { grid-template-columns: 1fr; }
    .wt-tabs-nav { flex-wrap: nowrap; }
}

.wt-fab-add {
    display: none;
    text-decoration: none;
}
@media (max-width: 768px) {
    .wt-fab-add {
        display: flex;
        position: fixed;
        bottom: 90px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: var(--wollo-primary);
        color: #fff;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        box-shadow: var(--wollo-shadow-lg);
        z-index: 100;
    }
}
