/* ==========================================================================
   Component Library — w-* primitives
   All values via var() from theme.css. Zero hardcode.
   Convention: .w-{component}[-{element}][--{modifier}]
   ========================================================================== */

/* --- CARD --- */
.w-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--sculpt-shadow), var(--sculpt-inner);
    border: 1px solid var(--sculpt-border);
}
.w-card--hover {
    transition: var(--transition);
    cursor: pointer;
}
.w-card--hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 82, 255, 0.15);
}
.w-card--flush {
    padding: 0;
}

/* --- TYPOGRAPHY --- */
.t-h1 { font-family: var(--font-heading, var(--font-body)); font-size: 48px; font-weight: 900; letter-spacing: -1.5px; line-height: 1.1; color: var(--text-dark); }
.t-h2 { font-family: var(--font-heading, var(--font-body)); font-size: 26px; font-weight: 900; letter-spacing: -0.5px; color: var(--text-dark); }
.t-h3 { font-family: var(--font-heading, var(--font-body)); font-size: 20px; font-weight: 800; color: var(--text-dark); }
.t-body { font-size: 15px; color: var(--text-muted); line-height: 1.7; }
.t-small { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.t-label { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.t-value { font-size: 18px; font-weight: 900; color: var(--text-dark); }

/* --- GRIDS --- */
.w-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--spacing-md, 16px); }
.w-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-md, 16px); }
.w-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--spacing-md, 16px); }
.w-grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--spacing-md, 16px); }

/* --- BADGE --- */
.w-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; font-weight: 800; padding: 3px 10px;
    border-radius: var(--radius-pill);
}
.w-badge--primary { color: var(--primary); background: var(--primary-bg); }
.w-badge--success { color: var(--success); background: var(--success-bg); }
.w-badge--error { color: var(--error); background: var(--error-bg-light, var(--error-bg)); }
.w-badge--warning { color: var(--warning); background: var(--warning-bg); }
.w-badge--neutral { color: var(--text-muted); background: var(--bg-body); }

/* --- ALERT --- */
.w-alert {
    display: flex; gap: 16px; padding: 24px 28px;
    border-radius: var(--radius-xl); align-items: flex-start;
    margin-bottom: 24px;
}
.w-alert--info {
    background: var(--primary-bg); border: 1px solid rgba(0, 82, 255, 0.12);
}
.w-alert--success {
    background: var(--success-bg); border: 1px solid rgba(16, 185, 129, 0.15);
}
.w-alert--warning {
    background: var(--warning-bg, #FFF8E1); border: 1px solid rgba(245, 158, 11, 0.15);
}
.w-alert--error {
    background: var(--error-bg); border: 1px solid var(--error-border);
}
.w-alert-icon {
    flex-shrink: 0; width: 40px; height: 40px;
    border-radius: 14px; display: flex; align-items: center; justify-content: center;
}
.w-alert--error .w-alert-icon { background: var(--error-icon-bg); }
.w-alert--warning .w-alert-icon { background: rgba(245, 158, 11, 0.15); }
.w-alert--info .w-alert-icon { background: rgba(0, 82, 255, 0.1); }
.w-alert--success .w-alert-icon { background: rgba(16, 185, 129, 0.12); }
.w-alert-title { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.w-alert--error .w-alert-title { color: var(--error-dark); }
.w-alert--warning .w-alert-title { color: var(--warning-dark, #92400E); }
.w-alert--info .w-alert-title { color: var(--primary); }
.w-alert--success .w-alert-title { color: var(--success-dark); }
.w-alert-text { font-size: 13px; line-height: 1.6; opacity: 0.8; }
.w-alert--error .w-alert-text { color: var(--error-text); }
.w-alert--warning .w-alert-text { color: var(--warning-dark, #92400E); }
.w-alert--info .w-alert-text { color: var(--primary); }
.w-alert--success .w-alert-text { color: var(--success-dark); }

/* --- STAT GRID --- */
.w-stat-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}
.w-stat-item {
    display: flex; flex-direction: column; gap: 4px; padding: 16px;
    background: var(--bg-body); border-radius: var(--radius-md);
    box-shadow: var(--sculpt-input);
}
.w-stat-label {
    font-size: 11px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.5px; font-weight: 800;
}
.w-stat-value { font-size: 18px; font-weight: 900; color: var(--text-dark); }
.w-stat-value--highlight { color: var(--success); }

/* --- KV LIST --- */
.w-kv-list { display: flex; flex-direction: column; }
.w-kv-row {
    display: flex; justify-content: space-between; padding: 10px 0;
    font-size: 14px; border-bottom: 1px dashed rgba(0,0,0,0.06);
}
.w-kv-row:last-child { border-bottom: none; }
.w-kv-label { color: var(--text-muted); font-weight: 500; }
.w-kv-value { font-weight: 800; color: var(--text-dark); }
.w-kv-value--highlight { color: var(--success); font-weight: 900; }

/* --- SLIDER FIELD (Calculator) --- */
.w-slider-field { margin-bottom: 8px; }
.w-slider-field label {
    display: flex; justify-content: space-between; font-weight: 700; font-size: 13px;
    color: var(--text-muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.5px;
}
.w-slider-value { color: var(--primary); font-size: 20px; font-weight: 900; }

/* --- CALCULATOR --- */
.w-calculator {
    padding: 36px 40px; display: grid; gap: 36px; align-items: flex-end;
    margin-bottom: 36px;
}
.w-calculator--cols-2 { grid-template-columns: 1fr 1fr; }
.w-calculator--cols-3 { grid-template-columns: 1fr 1fr 200px; }
.w-calculator-result { display: flex; flex-direction: column; gap: 8px; }
.w-calculator-result-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; padding: 4px 0;
}
.w-calculator-result-value { font-weight: 900; font-size: 16px; }
.w-calculator-result-value--negative { color: var(--error); font-weight: 900; }
.w-calculator-result-value--positive { color: var(--success); font-weight: 900; }

/* --- PRODUCT CARD --- */
.w-product-card {
    padding: 24px 32px; margin-bottom: 16px;
    display: grid; align-items: center; gap: 28px;
    transition: var(--transition); cursor: pointer; text-decoration: none; color: inherit;
}
.w-product-card:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-hover);
    border-color: rgba(0, 82, 255, 0.15);
}
.w-product-card--5col { grid-template-columns: 72px 2fr 1fr 1fr 160px; }
.w-product-card--4col { grid-template-columns: 72px 2fr 1fr 160px; }
.w-product-card--3col { grid-template-columns: 72px 1fr 160px; }

.w-product-logo {
    width: 64px; height: 64px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--sculpt-input); color: white; font-weight: 900; font-size: 11px;
    flex-shrink: 0; overflow: hidden;
}
.w-product-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; background: #fff; border-radius: 18px; }
.w-product-meta h3 { font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.w-product-meta h3 a { color: var(--text-dark); text-decoration: none; }
.w-product-meta h3 a:hover { color: var(--primary); }
.w-product-rating { display: flex; align-items: center; gap: 4px; color: var(--warning); font-size: 13px; font-weight: 700; }
.w-product-param { display: flex; flex-direction: column; gap: 4px; }
.w-product-param-label { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.w-product-param-value { font-size: 18px; font-weight: 900; white-space: nowrap; }
.w-product-param-value--highlight { color: var(--success); }
.w-product-footer {
    grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
    flex-wrap: wrap; margin-top: 4px;
}

/* --- STEPS --- */
.w-steps { display: grid; gap: var(--spacing-md, 16px); }
.w-steps--cols-2 { grid-template-columns: repeat(2, 1fr); }
.w-steps--cols-3 { grid-template-columns: repeat(3, 1fr); }
.w-steps--cols-4 { grid-template-columns: repeat(4, 1fr); }
.w-step {
    background: var(--bg-card); border-radius: var(--radius-xl);
    box-shadow: var(--sculpt-shadow), var(--sculpt-inner);
    border: 1px solid var(--sculpt-border);
    padding: 28px 24px; text-align: center; transition: var(--transition);
}
.w-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.w-step-num {
    width: 44px; height: 44px; background: var(--primary); color: #fff;
    border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 16px; margin-bottom: 16px;
    box-shadow: var(--shadow-primary-sm);
}
.w-step-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; color: var(--text-dark); }
.w-step-text { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

/* --- FAQ --- */
.w-faq { display: flex; flex-direction: column; gap: 8px; margin-bottom: 40px; }
.w-faq-item {
    background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--sculpt-shadow); border: 1px solid var(--sculpt-border);
    transition: border-color 0.2s;
}
.w-faq-item[open] { border-color: rgba(0, 82, 255, 0.15); }
.w-faq-q {
    padding: 16px 22px; font-weight: 700; font-size: 15px; cursor: pointer;
    list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px;
    color: var(--text-dark); transition: color 0.15s;
}
.w-faq-q:hover { color: var(--primary); }
.w-faq-q::-webkit-details-marker { display: none; }
.w-faq-chevron { flex-shrink: 0; color: var(--text-muted); transition: transform 0.2s; }
.w-faq-item[open] .w-faq-chevron { transform: rotate(180deg); color: var(--primary); }
.w-faq-a { padding: 0 22px 16px; font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* --- PROS & CONS --- */
.w-pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.w-pros-col { padding: 24px; border-radius: var(--radius-lg); background: var(--success-bg); }
.w-cons-col { padding: 24px; border-radius: var(--radius-lg); background: var(--error-bg-light, var(--error-bg)); }
.w-pros-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin: 0 0 16px; color: var(--success-dark); }
.w-cons-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin: 0 0 16px; color: var(--error-dark); }
.w-pros-list, .w-cons-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.w-pros-list li, .w-cons-list li { font-size: 14px; line-height: 1.5; padding-left: 20px; position: relative; }
.w-pros-list li::before { content: "+"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.w-cons-list li::before { content: "\2212"; position: absolute; left: 0; color: var(--error); font-weight: 800; }
.w-pros-list li { color: var(--success-dark); }
.w-cons-list li { color: var(--error-dark); }

/* --- DATA TABLE --- */
.w-data-table-wrap {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-xl); background: var(--bg-card);
    box-shadow: var(--sculpt-shadow), var(--sculpt-inner);
    border: 1px solid var(--sculpt-border);
}
.w-data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.w-data-table thead { background: var(--bg-body); }
.w-data-table th {
    padding: 14px 16px; text-align: left; font-weight: 800;
    font-size: 11px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.5px; border-bottom: 1px solid var(--border-faint); white-space: nowrap;
}
.w-data-table td {
    padding: 16px; border-bottom: 1px solid var(--border-faint);
    color: var(--text-dark); vertical-align: middle;
}
.w-data-table tbody tr:last-child td { border-bottom: none; }
.w-data-table tbody tr:hover { background: var(--bg-body); }
.w-data-table--responsive { min-width: 640px; }
.w-data-table .w-rank { font-weight: 900; color: var(--primary); font-size: 15px; width: 36px; text-align: center; }

/* --- FEATURE MATRIX --- */
.w-feature-matrix { width: 100%; border-collapse: collapse; }
.w-feature-matrix th, .w-feature-matrix td {
    padding: 12px 16px; text-align: center; border-bottom: 1px solid var(--border-faint);
}
.w-feature-matrix th { font-weight: 800; font-size: 13px; color: var(--text-dark); background: var(--bg-body); }
.w-feature-matrix td:first-child { text-align: left; font-weight: 600; color: var(--text-dark); }
.w-check { color: var(--success); font-weight: 900; font-size: 16px; }
.w-cross { color: var(--error); font-weight: 700; font-size: 16px; }

/* --- ICON TEXT --- */
.w-icon-text {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--text-muted);
}

/* --- EMBED (chart/map container) --- */
.w-embed {
    background: var(--bg-card); border-radius: var(--radius-xl);
    box-shadow: var(--sculpt-shadow), var(--sculpt-inner);
    border: 1px solid var(--sculpt-border); overflow: hidden;
    margin-bottom: 32px;
}
.w-embed-header { padding: 20px 24px 0; }
.w-embed-body { padding: 16px 24px 24px; min-height: 200px; }

/* --- CALENDAR --- */
.w-calendar { margin-bottom: 32px; }
.w-calendar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 0; margin-bottom: 12px;
}
.w-calendar-header h3 { font-size: 20px; font-weight: 800; color: var(--text-dark); }
.w-calendar-nav {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 8px 16px; border-radius: var(--radius-pill);
    background: var(--bg-body); color: var(--text-muted); font-weight: 700; font-size: 14px;
    text-decoration: none; transition: var(--transition);
}
.w-calendar-nav:hover { color: var(--primary); background: var(--primary-bg); }
.w-calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
}
.w-calendar-cell {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: var(--radius-md); font-size: 14px; font-weight: 600;
    color: var(--text-dark); transition: var(--transition); cursor: pointer;
    background: var(--bg-card); box-shadow: var(--sculpt-input);
}
.w-calendar-cell:hover { background: var(--primary-bg); color: var(--primary); }
.w-calendar-cell--today { background: var(--primary); color: #fff; box-shadow: var(--shadow-primary-sm); }
.w-calendar-cell--inactive { color: var(--text-muted); opacity: 0.4; cursor: default; background: transparent; box-shadow: none; }
.w-calendar-weekday { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; text-align: center; padding: 8px 0; }

/* --- DAY WIDGET --- */
.w-day-widget {
    background: var(--bg-card); border-radius: var(--radius-xl);
    box-shadow: var(--sculpt-shadow), var(--sculpt-inner);
    border: 1px solid var(--sculpt-border);
    padding: 28px 32px; margin-bottom: 32px;
}
.w-day-widget-title { font-size: 20px; font-weight: 900; color: var(--text-dark); margin-bottom: 8px; }
.w-day-widget-date { font-size: 14px; color: var(--text-muted); font-weight: 600; margin-bottom: 16px; }
.w-day-widget-text { font-size: 15px; color: var(--text-muted); line-height: 1.7; }

/* --- EXPERT BLOCK --- */
.w-expert {
    padding: 36px; margin-bottom: 40px;
    background: linear-gradient(145deg, var(--bg-card), var(--bg-body));
    border: 2px solid rgba(0, 82, 255, 0.08);
}
.w-expert-header { display: flex; align-items: center; gap: 20px; margin-bottom: 24px; }
.w-expert-avatar {
    width: 64px; height: 64px; border-radius: 50%; background: var(--bg-card);
    box-shadow: var(--sculpt-shadow); display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 900; color: var(--primary); border: 3px solid var(--primary);
    flex-shrink: 0; overflow: hidden;
}
.w-expert-avatar img { width: 100%; height: 100%; object-fit: cover; }
.w-expert-name { font-size: 20px; font-weight: 900; color: var(--text-dark); margin-bottom: 4px; }
.w-expert-role { font-size: 14px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.w-expert-text {
    font-size: 16px; line-height: 1.7; color: var(--text-dark); font-style: italic;
    border-left: 4px solid var(--primary); padding: 16px 24px;
    background: rgba(0, 82, 255, 0.03); border-radius: 0 14px 14px 0;
    margin-bottom: 28px;
}

/* --- REVIEWS --- */
.w-reviews { display: flex; flex-direction: column; gap: 16px; margin-bottom: 40px; }
.w-review {
    padding: 28px 32px;
    background: var(--bg-card); border-radius: var(--radius-xl);
    box-shadow: var(--sculpt-shadow), var(--sculpt-inner);
    border: 1px solid var(--sculpt-border);
}
.w-review-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.w-review-author { display: flex; align-items: center; gap: 14px; }
.w-review-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg-body); box-shadow: var(--sculpt-input);
    color: var(--primary); display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800; flex-shrink: 0;
}
.w-review-name { font-weight: 800; font-size: 15px; color: var(--text-dark); }
.w-review-meta { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.w-review-stars { display: flex; gap: 2px; }
.w-review-star-filled { color: var(--warning); font-size: 16px; }
.w-review-star-empty { color: var(--star-empty, #D1D5DB); font-size: 16px; }
.w-review-text { font-size: 15px; line-height: 1.7; color: var(--text-dark); margin-bottom: 8px; }
.w-review-pros { font-size: 13px; color: var(--success); margin-bottom: 4px; font-weight: 600; }
.w-review-cons { font-size: 13px; color: var(--error); font-weight: 600; }

/* ==========================================================================
   RESPONSIVE — w-* components
   ========================================================================== */

@media (max-width: 1200px) {
    .w-calculator--cols-3 { grid-template-columns: 1fr 1fr; }
    .w-calculator--cols-3 .w-calculator-result { grid-column: 1 / -1; }
    .w-product-card--5col { grid-template-columns: 64px 1.5fr 1fr 1fr; }
    .w-product-card--5col .btn-main,
    .w-product-card--5col .btn-cta { grid-column: 1 / -1; width: 100%; }
    .w-pros-cons { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .t-h1 { font-size: 34px; }
    .w-calculator { padding: 24px; grid-template-columns: 1fr !important; }
    .w-product-card--5col,
    .w-product-card--4col { grid-template-columns: 1fr 1fr; text-align: center; padding: 24px; gap: 20px; }
    .w-product-card--5col .w-product-logo,
    .w-product-card--4col .w-product-logo { margin: 0 auto; }
    .w-product-card--5col .w-product-meta,
    .w-product-card--4col .w-product-meta { grid-column: 1 / -1; }
    .w-product-card--5col .w-product-footer,
    .w-product-card--4col .w-product-footer { grid-column: 1 / -1; justify-content: center; }
    .w-steps--cols-4 { grid-template-columns: 1fr 1fr; }
    .w-steps--cols-3 { grid-template-columns: 1fr 1fr; }
    .w-pros-cons { grid-template-columns: 1fr; }
    .w-grid-2 { grid-template-columns: 1fr; }
    .w-grid-3 { grid-template-columns: 1fr 1fr; }
    .w-grid-4 { grid-template-columns: 1fr 1fr; }
    .w-expert { padding: 24px; }
    .w-expert-header { flex-direction: column; text-align: center; }
    .w-calendar-grid { gap: 2px; }
}

@media (max-width: 600px) {
    .t-h1 { font-size: 28px; }
    .w-steps--cols-4,
    .w-steps--cols-3,
    .w-steps--cols-2 { grid-template-columns: 1fr; }
    .w-grid-3, .w-grid-4 { grid-template-columns: 1fr; }
    .w-product-card--5col,
    .w-product-card--4col,
    .w-product-card--3col { grid-template-columns: 1fr; }
    .w-stat-grid { grid-template-columns: 1fr; }
}
