/**
 * Styles for single-que-es.php (herramienta individual)
 * Scroll-based layout with sticky nav, clean editorial design
 *
 * @package ecomninja
 */

/* ================================
   ALPINE.JS x-cloak (for expand toggles)
   ================================ */
[x-cloak] { display: none !important; }

/* ================================
   STICKY SECTION NAV
   ================================ */
.section-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e5e7eb;
    background: white;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    position: relative;
}

.section-nav::-webkit-scrollbar { display: none; }

.section-nav-item {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    border: none;
    background: none;
    white-space: nowrap;
    flex-shrink: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.section-nav-item:hover {
    color: #111827;
}

.section-nav-item.active {
    color: #d97706;
    border-bottom-color: #f59e0b;
}

.section-nav-wrapper {
    background: white;
    z-index: 50;
    transition: box-shadow 0.2s;
}

.section-nav-wrapper.is-stuck {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Mobile nav fade hint */
.section-nav-fade {
    display: none;
}

@media (max-width: 768px) {
    .section-nav-item {
        font-size: 13px;
        padding: 12px 14px;
    }

    .section-nav-fade {
        display: block;
        position: absolute;
        right: 0;
        top: 0;
        bottom: 2px;
        width: 24px;
        background: linear-gradient(to right, transparent, white);
        pointer-events: none;
        z-index: 1;
    }
}

/* ================================
   SECTION SCROLL OFFSET
   ================================ */
.scroll-target {
    scroll-margin-top: 80px;
}

/* ================================
   BUTTONS
   ================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: #111827;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-primary:hover {
    background-color: #1f2937;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.btn-secondary {
    background-color: #fbbf24;
    color: #78350f;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.25);
}

.btn-secondary:hover {
    background-color: #f59e0b;
}

.btn-outline {
    background-color: white;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.btn-expand {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #d97706;
    background: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-expand:hover {
    background-color: #fffbeb;
    border-color: #f59e0b;
}

/* ================================
   SECTION TITLES
   ================================ */
.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin-top: 3rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* ================================
   HERO
   ================================ */
.hero-clean {
    padding: 32px 0 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.hero-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

.hero-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hero-logo-fallback {
    font-size: 1.25rem;
    font-weight: 700;
    color: #6b7280;
}

/* Hero chips */
.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 100px;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    transition: opacity 0.15s;
}
.hero-chip:hover { opacity: 0.8; }
.hero-chip--category {
    background: #1f2937;
    color: #fff;
}
.hero-chip--amber {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.hero-chip--green {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.hero-chip--blue {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.hero-chip--gray {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

/* Hero identity row */
.hero-identity-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.hero-identity-sep {
    width: 1px;
    height: 14px;
    background: #d1d5db;
    margin: 0 2px;
}

/* Hero description */
.hero-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hero actions row */
.hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.hero-meta-sep {
    width: 1px;
    height: 16px;
    background: #e5e7eb;
    margin: 0 4px;
}
.hero-meta-item {
    font-size: 11px;
    color: #9ca3af;
}
.hero-meta-item + .hero-meta-item::before {
    content: '·';
    margin-right: 8px;
}

/* Small buttons */
.btn-sm {
    padding: 6px 16px;
    font-size: 13px;
}

.hero-score-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hero-score-badge span {
    font-size: 20px;
    font-weight: 800;
    color: white;
}

.hero-score-badge.score-green { background-color: #059669; }
.hero-score-badge.score-amber { background-color: #d97706; }
.hero-score-badge.score-red { background-color: #dc2626; }

.hero-score-label {
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
    margin-top: 4px;
}

/* quick-stats removed — kept for compat */
.hero-quick-stats {
    display: none;
}
.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.hero-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.hero-stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}
.hero-stat-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================================
   BREADCRUMBS
   ================================ */
.breadcrumb-nav {
    font-size: 13px;
    margin: 16px 0 12px;
}

.breadcrumb-nav a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    color: #d97706;
}

.breadcrumb-sep {
    margin: 0 6px;
    color: #9ca3af;
}

/* ================================
   VERDICT BOX
   ================================ */
.verdict-box {
    background: #f0fdf4;
    border-left: 4px solid #059669;
    padding: 20px 24px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.verdict-box-score {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.verdict-box p,
.verdict-box div {
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
}

/* ================================
   PROS & CONS (simplified)
   ================================ */
.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .pros-cons-grid {
        grid-template-columns: 1fr;
    }
}

.pros-column {
    border-left: 3px solid #059669;
    padding-left: 16px;
}

.cons-column {
    border-left: 3px solid #dc2626;
    padding-left: 16px;
}

.pros-column h3 {
    font-size: 16px;
    font-weight: 600;
    color: #059669;
    margin-bottom: 12px;
}

.cons-column h3 {
    font-size: 16px;
    font-weight: 600;
    color: #dc2626;
    margin-bottom: 12px;
}

.pros-column li,
.cons-column li {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    list-style: none;
    position: relative;
    padding-left: 1.5rem;
}

.pros-column li:last-child,
.cons-column li:last-child {
    border-bottom: none;
}

.pros-column li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23059669' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.cons-column li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.7rem;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23dc2626' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ================================
   ANALYSIS TRUNCATION
   ================================ */
.analysis-wrapper {
    position: relative;
    max-height: 600px;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.analysis-wrapper.is-expanded {
    max-height: none;
}

.analysis-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ================================
   PRICING
   ================================ */
.pricing-content {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.pricing-content .prose {
    color: #78350f;
}

.pricing-content .prose strong {
    color: #451a03;
}

.pricing-callout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.1);
}

.pricing-callout-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.pricing-date-note {
    margin-top: 1.5rem;
    font-size: 13px;
    color: #92400e;
    text-align: center;
    font-style: italic;
}

/* ================================
   FICHA TECNICA (Sidebar)
   ================================ */
.ficha-tecnica {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.ficha-tecnica-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ficha-rating-big {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
}

.ficha-rating-big.rating-green { color: #059669; }
.ficha-rating-big.rating-amber { color: #d97706; }
.ficha-rating-big.rating-red { color: #dc2626; }
.ficha-rating-big.rating-none { color: #9ca3af; }

.ficha-facts {
    padding: 1rem 1.5rem;
}

.ficha-fact {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.ficha-fact:last-child {
    border-bottom: none;
}

.ficha-fact-label {
    color: #6b7280;
    font-weight: 400;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.ficha-fact-value {
    color: #111827;
    font-weight: 500;
    text-align: right;
}

.ficha-cta {
    padding: 1rem 1.5rem 1.5rem;
}

/* ================================
   RATING BREAKDOWN (sidebar)
   ================================ */
.rating-breakdown {
    padding: 1rem 1.5rem;
    border-top: 1px solid #f3f4f6;
}

.rating-breakdown h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
    font-size: 0.8rem;
}

.rating-bar-label {
    width: 1.5rem;
    text-align: right;
    color: #6b7280;
    font-weight: 500;
    flex-shrink: 0;
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #fbbf24, #f59e0b);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.rating-bar-count {
    width: 1.5rem;
    text-align: left;
    color: #9ca3af;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ================================
   BADGES
   ================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-amber { background-color: #fffbeb; color: #b45309; }
.badge-emerald { background-color: #ecfdf5; color: #047857; }
.badge-blue { background-color: #eff6ff; color: #1d4ed8; }

/* ================================
   FAQ ACCORDION
   ================================ */
.faq-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.faq-item {
    border-bottom: 1px solid #f3f4f6;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.faq-question:hover {
    color: #d97706;
    background-color: #fffbeb;
}

.faq-question-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.2s ease;
    color: #d97706;
}

.faq-item.open .faq-question-icon {
    transform: rotate(180deg);
}

.faq-item.open .faq-question {
    color: #92400e;
    background-color: #fffbeb;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer-inner {
    padding: 0 20px 16px;
    color: #4b5563;
    line-height: 1.7;
    font-size: 14px;
}

/* ================================
   ALTERNATIVES LIST
   ================================ */
.alternatives-list {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
}

.alternative-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.alternative-item:last-child { border-bottom: none; }
.alternative-item:hover { background-color: #fffbeb; }

.alternative-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

.alternative-info { flex: 1; min-width: 0; }

.alternative-name {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
    text-decoration: none;
    display: block;
}

a.alternative-name:hover { color: #d97706; }

.alternative-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
    margin-top: 2px;
}

.alternative-arrow {
    flex-shrink: 0;
    color: #9ca3af;
    transition: color 0.2s, transform 0.2s;
}

.alternative-item:hover .alternative-arrow {
    color: #d97706;
    transform: translateX(2px);
}

/* ================================
   COMPARISONS LIST
   ================================ */
.comparison-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 15px;
    color: #111827;
    text-decoration: none;
    transition: background-color 0.2s;
}

.comparison-row:last-child { border-bottom: none; }

.comparison-row:hover {
    background-color: #fffbeb;
    padding-left: 8px;
    padding-right: 8px;
    margin-left: -8px;
    margin-right: -8px;
    border-radius: 8px;
}

.comparison-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comparison-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.comparison-arrow {
    margin-left: auto;
    color: #d97706;
    flex-shrink: 0;
}

/* ================================
   COMPETITOR PRICING TABLE
   ================================ */
.competitor-pricing-table {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.competitor-pricing-header {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    align-items: center;
}

.competitor-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    gap: 1rem;
    padding: 1rem 1.5rem;
    align-items: center;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.competitor-row:last-child { border-bottom: none; }
.competitor-row:hover { background-color: #fffbeb; }

.competitor-row--current {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-left: 3px solid #f59e0b;
}

.competitor-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.competitor-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.competitor-logo-fallback {
    font-size: 0.625rem;
    font-weight: 700;
    color: #9ca3af;
}

.competitor-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.9375rem;
}

.competitor-badge {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 9999px;
    margin-left: 0.5rem;
    text-transform: uppercase;
}

.competitor-rating { font-weight: 700; font-size: 0.9375rem; }
.competitor-rating.rating-green { color: #059669; }
.competitor-rating.rating-amber { color: #d97706; }
.competitor-rating.rating-red { color: #dc2626; }
.competitor-rating.rating-none { color: #9ca3af; }

.competitor-price { font-size: 0.875rem; color: #374151; font-weight: 500; }

.competitor-action {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #d97706;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.competitor-action:hover { color: #92400e; }

.competitor-pricing-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #92400e;
    text-align: center;
    opacity: 0.7;
}

/* ================================
   COLLAPSIBLE SECTIONS (<details>)
   ================================ */
.collapsible-section {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.collapsible-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color 0.2s;
}

.collapsible-summary::-webkit-details-marker { display: none; }
.collapsible-summary:hover { background-color: #fffbeb; }

.collapsible-arrow {
    width: 1.25rem;
    height: 1.25rem;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

details[open] > .collapsible-summary .collapsible-arrow {
    transform: rotate(180deg);
}

.collapsible-content {
    padding: 0 1.25rem 1.25rem;
}

/* ================================
   LOGO (Sidebar)
   ================================ */
.logo-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    width: 100%;
}

.logo-sidebar img {
    max-height: 70px;
    max-width: 100%;
    object-fit: contain;
}

.logo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    width: 64px;
    background-color: #f3f4f6;
    border-radius: 12px;
    color: #6b7280;
    font-weight: 600;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.25rem;
        margin-top: 2rem;
    }

    .hero-clean {
        padding: 20px 0 16px;
    }

    .hero-score-badge {
        width: 48px;
        height: 48px;
    }

    .hero-score-badge span {
        font-size: 17px;
    }

    .competitor-pricing-header { display: none; }

    .competitor-row {
        grid-template-columns: auto 1fr;
        gap: 0.5rem 0.75rem;
        padding: 1rem;
    }

    .competitor-rating,
    .competitor-price,
    .competitor-action {
        grid-column: 2;
        font-size: 0.8125rem;
    }

    .competitor-logo {
        grid-row: 1 / span 4;
        align-self: start;
    }
}

/* ================================
   HIDE SCROLLBAR UTILITY
   ================================ */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
