.pw-tire-container *,
.pw-tire-container *::before,
.pw-tire-container *::after,
.pw-tire-results-section *,
.pw-tire-results-section *::before,
.pw-tire-results-section *::after {
    box-sizing: border-box;
}

.pw-tire-container {
    max-width: 1200px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeIn 0.6s ease-in;
}

[data-theme="light"] .pw-tire-container {
    background: rgba(255, 255, 255, 0.98);
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.pw-tire-header {
    background: linear-gradient(135deg, #2c2c2c, #5a5a5a, #8a8a8a);
    color: white;
    padding: 50px 30px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.pw-tire-header h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 10px; font-weight: 700; position: relative; z-index: 1; }
.pw-tire-header p { font-size: clamp(1rem, 2vw, 1.1rem); opacity: 0.9; position: relative; z-index: 1; }

.pw-tire-main-content { padding: 40px; display: grid; grid-template-columns: 1fr; gap: 40px; width: 100%; }

.pw-tire-input-section {
    background: white;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 780px;
    margin: auto;
    width: 100%;
}

.pw-tire-input-group { margin-bottom: 25px; position: relative; }
.pw-tire-input-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #2c3e50; font-size: 1.1em; }
.pw-tire-input-group input { width: 100%; padding: 12px; border: 2px solid #e1e8ed; font-size: 1.1em; transition: all 0.3s ease; background: #fff; color: #333; }
.pw-tire-input-group input:focus { outline: none; border-color: #5a5a5a; box-shadow: 0 0 0 3px rgba(90, 90, 90, 0.1); }
.pw-tire-input-group input.valid { border-color: #27ae60; }
.pw-tire-input-group input.invalid { border-color: #e74c3c; }
.pw-tire-format-hint { font-size: 0.85em; color: #666; margin-top: 5px; font-style: italic; }

.validation-message { font-size: 0.9em; margin-top: 5px; padding: 5px 10px; display: none; }
.validation-message.success { color: #27ae60; background: #d4edda; display: block; }
.validation-message.error { color: #e74c3c; background: #f8d7da; display: block; }

.pw-tire-calculate-btn {
    width: 100%; padding: 15px; background: linear-gradient(135deg, #2c2c2c, #4a4a4a); color: white;
    border: none; font-size: 1.2em; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    position: relative; overflow: hidden;
}
.pw-tire-calculate-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); }
.pw-tire-calculate-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.report-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.action-btn { padding: 12px 20px; border: none; font-size: 1em; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px; color: white; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.action-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
.share-btn { background: linear-gradient(135deg, #27ae60, #229954); }
.download-btn { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.print-btn { background: linear-gradient(135deg, #5a5a5a, #7a7a7a); }

.tire-visual-comparison { background: linear-gradient(135deg, #f8f9fa, #e9ecef); padding: 30px; margin: 30px 0; display: none; animation: scaleIn 0.5s ease-out; }
.tire-visual-comparison.active { display: block; }
.tire-visual-comparison h3 { color: #2c3e50; margin-bottom: 20px; text-align: center; }
.tire-comparison-svg { display: flex; justify-content: space-around; align-items: flex-end; gap: 20px; margin: 20px 0; }
.tire-svg-container { flex: 1; text-align: center; min-width: 0; overflow: hidden; }
.tire-svg-container svg { max-width: 100%; height: auto; }
.tire-svg-label { font-weight: 600; color: #2c3e50; margin-bottom: 10px; }

.pw-tire-results-section, .pw-tire-comparison-section {
    background: white; padding: 30px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); animation: slideIn 0.5s ease-out; width: 100%;
    max-width: 1200px; margin-left: auto; margin-right: auto;
}
.pw-tire-comparison-section { margin-bottom: 40px; overflow-x: auto; }
.pw-tire-results-grid { display: grid; gap: 20px; }
.pw-tire-result-card { background: linear-gradient(135deg, #f8f9fa, #e9ecef); padding: 20px; border-left: 5px solid #5a5a5a; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.pw-tire-result-card:hover { transform: translateX(5px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
.pw-tire-result-card h3 { color: #2c3e50; margin-bottom: 10px; font-size: 1.2em; }
.pw-tire-result-value { font-size: 1.8em; font-weight: bold; color: #2c2c2c; margin-bottom: 5px; }
.pw-tire-result-description { color: #7f8c8d; font-size: 0.9em; line-height: 1.4; }

.pw-tire-table-wrap { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pw-tire-comparison-table { border-collapse: collapse; margin-top: 20px; width: 100%; table-layout: auto; }
.pw-tire-comparison-table th, .pw-tire-comparison-table td { white-space: nowrap; padding: 15px; text-align: left; border-bottom: 1px solid #e1e8ed; }
.pw-tire-comparison-table th:first-child, .pw-tire-comparison-table td:first-child { white-space: normal; }
.pw-tire-comparison-table thead th { background: linear-gradient(135deg, #2c2c2c, #4a4a4a); color: #fff; font-weight: 600; position: sticky; top: 0; z-index: 1; }
.pw-tire-comparison-table tr:hover { background: #f8f9fa; }

.popular-sizes-section { background: white; padding: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); max-width: 780px; margin: 0 auto; width: 100%; overflow: hidden; }
.popular-sizes-header { display: flex; justify-content: space-between; align-items: center; padding: 18px 30px; cursor: pointer; background: linear-gradient(135deg, #f8f9fa, #e9ecef); border-bottom: 2px solid #e1e8ed; transition: background 0.2s ease; user-select: none; }
.popular-sizes-header:hover { background: linear-gradient(135deg, #e9ecef, #dee2e6); }
.popular-sizes-header h3 { color: #2c3e50; margin: 0; font-size: 1.2em; }
.popular-sizes-toggle { font-size: 1em; color: #5a5a5a; transition: transform 0.3s ease; }
.popular-sizes-toggle.open { transform: rotate(180deg); }
.popular-sizes-body { padding: 20px 30px 30px; }

.tire-size-group { margin-bottom: 8px; }
.tire-size-group:last-child { margin-bottom: 0; }
.tire-size-group-label { color: #2c3e50; font-size: 1.1em; font-weight: 600; padding: 12px 14px; border: 2px solid #e1e8ed; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s ease; user-select: none; margin-bottom: 0; background: #fafbfc; }
.tire-size-group-label:hover { background: linear-gradient(135deg, #e9ecef, #dee2e6); border-color: #5a5a5a; }
.tire-size-group-label.active { background: linear-gradient(135deg, #2c2c2c, #4a4a4a); color: white; border-color: #2c2c2c; }
.tire-group-caret { font-size: 0.8em; transition: transform 0.3s ease; display: inline-block; }
.tire-size-group-label.active .tire-group-caret { transform: rotate(90deg); }

.popular-sizes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 12px 14px; border: 2px solid #e1e8ed; border-top: none; background: white; }
.popular-size-btn { padding: 10px 15px; background: linear-gradient(135deg, #ecf0f1, #bdc3c7); border: 2px solid #95a5a6; cursor: pointer; transition: all 0.3s ease; font-size: 0.9em; font-weight: 600; color: #2c3e50; }
.popular-size-btn:hover { background: linear-gradient(135deg, #5a5a5a, #7a7a7a); color: white; border-color: #5a5a5a; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(90, 90, 90, 0.3); }
.popular-size-btn.selected-current { background: linear-gradient(135deg, #2c2c2c, #4a4a4a); color: white; border-color: #2c2c2c; box-shadow: 0 4px 12px rgba(44, 44, 44, 0.4); font-weight: 700; }
.popular-size-btn.selected-new { background: linear-gradient(135deg, #e74c3c, #c0392b); color: white; border-color: #e74c3c; box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4); font-weight: 700; }

.pw-tire-footer { background: #2c3e50; color: white; padding: 20px; text-align: center; }
.pw-tire-footer a { color: #3498db; text-decoration: none; }

.pw-tire-speedo-label { font-size: 0.9em; color: #666; margin-bottom: 8px; display: block; }
.pw-tire-speedo-scale { display: flex; justify-content: space-between; font-size: 0.8em; color: #999; margin-top: 5px; }
.pw-tire-speedo-unit { text-align: center; font-size: 0.75em; color: #aaa; margin-top: 2px; }
.pw-tire-speedo-box { background: #f8f9fa; padding: 10px; font-size: 0.9em; border-left: 3px solid #5a5a5a; color: #333; }

.pw-tire-info-section { background: #fff; padding: 30px; margin: 30px 0 40px; }
.pw-tire-info-section h2 { color: #2c3e50; font-size: clamp(1.8rem, 2.4vw, 3rem); margin-bottom: 16px; }
.pw-tire-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 14px; }
.pw-tire-info-card { padding: 20px; background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.pw-tire-info-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08); }
.pw-tire-info-card h3 { color: #2c2c2c; margin-bottom: 10px; font-size: 1.4rem; }
.pw-tire-info-card p { color: #6c757d; line-height: 1.7; }

.pw-tire-faq-section { background: #f8f9fa; padding: 30px; }
.pw-tire-faq-section h2 { color: #2c3e50; font-size: clamp(1.8rem, 2.4vw, 3rem); margin-bottom: 16px; }
.pw-tire-faq-item { background: #fff; padding: 16px; margin-bottom: 12px; cursor: pointer; transition: box-shadow 0.2s ease; outline: none; }
.pw-tire-faq-item:hover { box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08); }
.pw-tire-faq-item:focus-visible { box-shadow: 0 0 0 3px rgba(90, 90, 90, 0.25); }
.pw-tire-faq-question { display: flex; justify-content: space-between; align-items: center; color: #495057; font-weight: 600; }
.pw-tire-faq-caret { margin-left: 12px; transition: transform 0.2s ease; }
.pw-tire-faq-item[aria-expanded="true"] .pw-tire-faq-caret { transform: rotate(180deg); }
.pw-tire-faq-answer { color: #6c757d; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e9ecef; line-height: 1.75; }

.pw-tire-share-section { text-align: center; padding: 26px; background: linear-gradient(135deg, #2c2c2c, #4a4a4a); color: #fff; margin-top: 30px; }
.pw-tire-share-section h3 { font-size: clamp(1.1rem, 2.1vw, 1.4rem); margin-bottom: 6px; }
.pw-tire-share-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.pw-tire-share-btn { padding: 10px 16px; background: rgba(255, 255, 255, 0.18); color: #fff; border: 2px solid #fff; font-weight: 600; cursor: pointer; transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease; }
.pw-tire-share-btn:hover { background: #fff; color: #2980b9; transform: translateY(-1px); }

@media (max-width: 768px) {
    .pw-tire-main-content { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
    .pw-tire-results-section { margin: 0 20px 40px 20px; }
    .pw-tire-comparison-table thead th { position: static; }
    .pw-tire-comparison-table th, .pw-tire-comparison-table td { padding: 10px 8px; font-size: 0.85rem; }
    .popular-sizes-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .tire-visual-comparison { padding: 20px 10px; }
    .tire-comparison-svg { gap: 10px; }
    .tire-svg-container svg { width: 140px; height: 140px; }
    .pw-tire-header { padding: 40px 20px 30px; }
}

@media (max-width: 480px) {
    .pw-tire-info-section, .pw-tire-faq-section { padding: 22px; }
    .action-btn { flex: 1 1 100%; justify-content: center; }
}

/* ── Dark mode (default theme) overrides ── */
:root:not([data-theme="light"]) .pw-tire-container {
    background: #2a2a2a;
}
:root:not([data-theme="light"]) .pw-tire-input-section {
    background: #3a3a3a;
}
:root:not([data-theme="light"]) .pw-tire-input-group label { color: #e0e0e0; }
:root:not([data-theme="light"]) .pw-tire-input-group input { background: #4a4a4a; color: #f0f0f0; border-color: #555; }
:root:not([data-theme="light"]) .pw-tire-input-group input:focus { border-color: #C9A84C; box-shadow: 0 0 0 3px rgba(201,168,76,0.2); }
:root:not([data-theme="light"]) .pw-tire-format-hint { color: #aaa; }

:root:not([data-theme="light"]) .pw-tire-results-section,
:root:not([data-theme="light"]) .pw-tire-comparison-section {
    background: #3a3a3a;
    color: #1a1a1a;
}
:root:not([data-theme="light"]) .pw-tire-comparison-table td {
    color: #1a1a1a;
    background: #b0b0b0;
    border-bottom-color: #999;
}
:root:not([data-theme="light"]) .pw-tire-comparison-table tr:hover td {
    background: #c0c0c0;
}
:root:not([data-theme="light"]) .pw-tire-comparison-section h2,
:root:not([data-theme="light"]) .pw-tire-comparison-section h3 {
    color: #f0f0f0;
}

:root:not([data-theme="light"]) .pw-tire-result-card {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
    border-left-color: #C9A84C;
}
:root:not([data-theme="light"]) .pw-tire-result-card h3 { color: #e0e0e0; }
:root:not([data-theme="light"]) .pw-tire-result-value { color: #f0f0f0; }
:root:not([data-theme="light"]) .pw-tire-result-description { color: #aaa; }

:root:not([data-theme="light"]) .tire-visual-comparison {
    background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
}
:root:not([data-theme="light"]) .tire-visual-comparison h3 { color: #e0e0e0; }
:root:not([data-theme="light"]) .tire-svg-label { color: #e0e0e0; }

:root:not([data-theme="light"]) .popular-sizes-section { background: #3a3a3a; }
:root:not([data-theme="light"]) .popular-sizes-header { background: linear-gradient(135deg, #4a4a4a, #3a3a3a); border-bottom-color: #555; }
:root:not([data-theme="light"]) .popular-sizes-header h3 { color: #e0e0e0; }
:root:not([data-theme="light"]) .tire-size-group-label { color: #e0e0e0; background: #4a4a4a; border-color: #555; }
:root:not([data-theme="light"]) .tire-size-group-label:hover { background: linear-gradient(135deg, #555, #4a4a4a); border-color: #C9A84C; }
:root:not([data-theme="light"]) .popular-sizes-grid { background: #3a3a3a; border-color: #555; }
:root:not([data-theme="light"]) .popular-size-btn { background: linear-gradient(135deg, #555, #4a4a4a); border-color: #666; color: #e0e0e0; }
:root:not([data-theme="light"]) .popular-size-btn:hover { background: linear-gradient(135deg, #C9A84C, #A8893A); color: #fff; border-color: #C9A84C; }

:root:not([data-theme="light"]) .pw-tire-info-section { background: #2a2a2a; }
:root:not([data-theme="light"]) .pw-tire-info-section h2 { color: #e0e0e0; }
:root:not([data-theme="light"]) .pw-tire-info-card { background: linear-gradient(135deg, #3a3a3a, #2a2a2a); }
:root:not([data-theme="light"]) .pw-tire-info-card h3 { color: #e0e0e0; }
:root:not([data-theme="light"]) .pw-tire-info-card p { color: #aaa; }

:root:not([data-theme="light"]) .pw-tire-faq-section { background: #1a1a1a; }
:root:not([data-theme="light"]) .pw-tire-faq-section h2 { color: #e0e0e0; }
:root:not([data-theme="light"]) .pw-tire-faq-item { background: #2a2a2a; }
:root:not([data-theme="light"]) .pw-tire-faq-question { color: #e0e0e0; }
:root:not([data-theme="light"]) .pw-tire-faq-answer { color: #aaa; border-top-color: #444; }

:root:not([data-theme="light"]) .pw-tire-speedo-label { color: #bbb; }
:root:not([data-theme="light"]) .pw-tire-speedo-scale { color: #888; }
:root:not([data-theme="light"]) .pw-tire-speedo-unit { color: #888; }
:root:not([data-theme="light"]) .pw-tire-speedo-box { background: #4a4a4a; border-left-color: #C9A84C; color: #e0e0e0; }
:root:not([data-theme="light"]) .pw-tire-speedo-box strong { color: #f0f0f0; }

:root:not([data-theme="light"]) .report-actions .action-btn { color: #fff; }
:root:not([data-theme="light"]) .validation-message.success { background: #1a3a1a; color: #4ade80; }
:root:not([data-theme="light"]) .validation-message.error { background: #3a1a1a; color: #f87171; }

@media print {
    .pw-tire-share-section, .pw-tire-calculate-btn, .popular-sizes-section,
    .report-actions, .pw-tire-input-section, .pw-tire-info-section,
    .pw-tire-faq-section, .pw-tire-footer, .pw-tire-header,
    .header, .footer, .page-hero, .final-cta { display: none !important; }
    .tire-visual-comparison { display: block !important; margin: 0; padding: 0; background: white; }
    .pw-tire-comparison-section { margin: 0; padding: 0; }
    .pw-tire-comparison-table th { background: #2c2c2c !important; color: white !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; box-shadow: none !important; }
}
