/* Estilos Públicos: TransformAgro Rewards (Minimalista) */
:root {
    --tagro-green: #064e3b;
    --tagro-gold: #fbbf24;
    --tagro-light: #f8fafc;
    --tagro-border: #f1f5f9;
    --tagro-text-main: #0f172a;
    --tagro-text-muted: #64748b;
}

.tagro-front-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    padding-bottom: 40px;
}

.tagro-front-notice {
    background: var(--tagro-light);
    color: var(--tagro-text-main);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    margin: 20px;
}

/* Tarjeta Digital Clean y Premium */
.tagro-premium-card {
    background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1.58 / 1; /* Proporción de tarjeta de crédito real */
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(6, 78, 59, 0.25), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
}
.tagro-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.tagro-card-logo {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
    z-index: 2;
}
.tagro-card-chip {
    width: 48px;
    height: 36px;
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    border-radius: 6px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.5), inset 0 -1px 2px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
}
.tagro-chip-line-v { width: 1px; height: 100%; background: rgba(0,0,0,0.15); position: absolute; left: 16px; }
.tagro-chip-line-h { width: 100%; height: 1px; background: rgba(0,0,0,0.15); position: absolute; top: 12px; }

.tagro-card-middle {
    text-align: left;
    z-index: 2;
}
.tagro-points-huge {
    font-size: 3rem;
    font-weight: 300;
    color: var(--tagro-gold);
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.tagro-points-label {
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 2px;
    opacity: 0.8;
    margin-left: 8px;
}

.tagro-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 2;
}
.tagro-card-user h3 {
    margin: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.tagro-card-user p {
    margin: 4px 0 0 0;
    font-size: 0.8rem;
    color: #a7f3d0;
    letter-spacing: 1px;
}
.tagro-card-level {
    text-align: right;
}
.tagro-card-level p {
    margin: 0;
    font-size: 0.65rem;
    color: #a7f3d0;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tagro-card-level h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Brillo asimétrico para realismo */
.tagro-card-glare {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 40%);
    transform: rotate(30deg);
    pointer-events: none;
    z-index: 1;
}

/* Navegación por pestañas sutil */
.tagro-front-tabs {
    display: flex;
    background: transparent;
    padding: 0 20px;
    border-bottom: 1px solid var(--tagro-border);
}
.tagro-tab-btn {
    background: transparent;
    border: none;
    padding: 20px 15px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--tagro-text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    margin-right: 20px;
}
.tagro-tab-btn:hover {
    color: var(--tagro-text-main);
}
.tagro-tab-btn.active {
    color: var(--tagro-green);
    border-bottom-color: var(--tagro-green);
}

.tagro-tab-content {
    padding: 40px 20px;
    display: none;
}
.tagro-tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Niveles Minimalistas */
.tagro-level-section {
    margin-bottom: 50px;
}
.tagro-level-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}
.tagro-level-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--tagro-text-main);
    flex: 1;
}
.tagro-level-icon {
    width: 24px;
    height: 24px;
    object-fit: cover;
    opacity: 0.8;
}
.tagro-level-range {
    color: var(--tagro-text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

/* Grilla de recompensas */
.tagro-rewards-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 40px 30px !important;
}
.tagro-reward-card {
    background: #fff !important;
    border: 1px solid #e1e7ec !important;
    border-radius: 12px !important;
    padding: 15px !important;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02) !important;
}
.tagro-reward-card:hover {
    box-shadow: 0 10px 15px rgba(0,0,0,0.05) !important;
    transform: translateY(-2px);
}
.tagro-reward-card.tagro-locked {
    opacity: 0.6 !important;
    filter: grayscale(100%) !important;
}
.tagro-reward-img {
    height: 180px !important;
    width: 100% !important;
    background-color: var(--tagro-border) !important;
    background-size: cover !important;
    background-position: center !important;
    border-radius: 8px !important;
    margin-bottom: 16px !important;
}
.tagro-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    height: 100%;
}
.tagro-reward-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.tagro-reward-body h4 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--tagro-text-main);
}
.tagro-reward-desc {
    font-size: 0.9rem;
    color: var(--tagro-text-muted);
    margin: 0 0 20px 0;
    flex: 1;
    line-height: 1.5;
}
.tagro-reward-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.tagro-reward-cost {
    font-weight: 600;
    color: var(--tagro-text-main);
    font-size: 1.1rem;
}
.tagro-reward-stock {
    font-size: 0.75rem;
    color: var(--tagro-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tagro-reward-stock.out {
    color: #dc2626;
}

.tagro-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    border: 1px solid var(--tagro-green);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
    background: transparent;
    color: var(--tagro-green);
    transition: all 0.2s ease;
}
.tagro-btn-redeem:hover {
    background: var(--tagro-green);
    color: #fff;
}
.tagro-btn:disabled {
    border-color: var(--tagro-border);
    background: transparent;
    color: #cbd5e1;
    cursor: not-allowed;
}

/* Tabla historial minimalista */
.tagro-front-table {
    width: 100%;
    border-collapse: collapse;
}
.tagro-front-table th, .tagro-front-table td {
    padding: 16px 10px;
    border-bottom: 1px solid var(--tagro-border);
    text-align: left;
    font-size: 0.95rem;
}
.tagro-front-table th {
    color: var(--tagro-text-muted);
    font-weight: 400;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tagro-front-table td {
    color: var(--tagro-text-main);
}
.points-cell {
    font-weight: 500;
}

#tagro-front-message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    font-size: 0.95rem;
}
.tagro-msg-success { background: #ecfdf5; color: #047857; }
.tagro-msg-error { background: #fef2f2; color: #b91c1c; }

/* -------------------------------------
   HUB & APP NAVIGATION (iOS Settings style)
-------------------------------------- */
.tagro-back-navigation {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--tagro-border);
}
.tagro-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--tagro-green);
    text-decoration: none !important;
    font-weight: 600;
    font-size: 1rem;
}
.tagro-btn-back:hover {
    color: #064e3b;
}

.tagro-hub-menu {
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid var(--tagro-border);
    margin: 20px 0;
    overflow: hidden;
}

.tagro-menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--tagro-border);
    text-decoration: none !important;
    color: inherit;
    transition: background 0.2s ease;
}
.tagro-menu-item:last-child {
    border-bottom: none;
}
.tagro-menu-item:hover:not(.locked) {
    background: #f9fafb;
}
.tagro-menu-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f9fafb;
}

.tagro-icon-bg {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 16px;
    flex-shrink: 0;
}
.tagro-icon-blue { background: #e0f2fe; color: #0284c7; }
.tagro-icon-green { background: #dcfce7; color: #16a34a; }
.tagro-icon-purple { background: #f3e8ff; color: #9333ea; }
.tagro-icon-orange { background: #ffedd5; color: #ea580c; }
.tagro-icon-gold { background: #fef3c7; color: #d97706; }
.tagro-icon-gray { background: #f3f4f6; filter: grayscale(1); }

.tagro-item-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.tagro-item-text strong {
    font-size: 1.1rem;
    color: #111827;
    margin-bottom: 2px;
}
.tagro-item-text span {
    font-size: 0.85rem;
    color: #6b7280;
}

.tagro-item-arrow {
    font-size: 2rem;
    color: #d1d5db;
    margin-left: 10px;
    padding-bottom: 4px; /* Optical alignment */
}

/* Apprentice Banner */
.tagro-apprentice-banner {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(145deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
    margin-bottom: 30px;
}
.tagro-apprentice-banner .tagro-app-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}
.tagro-apprentice-banner h3 {
    margin: 0 0 10px 0;
    color: #334155;
    font-size: 1.5rem;
}
.tagro-apprentice-banner p {
    color: #64748b;
    font-size: 0.95rem;
    padding: 0 20px;
}

