/* Tools section shared styles */

/* Generic helpers */
.btn-block {
    width: 100%;
    justify-content: center;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    color: var(--text-lighter);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs span[aria-current="page"] {
    color: var(--text-dark);
    font-weight: 500;
}

/* ========================
   HUB de herramientas
   ======================== */
.tools-hero {
    margin-top: 70px;
    padding: 80px 0 60px;
    background: linear-gradient(135deg, var(--background-light) 0%, #e2e8f0 100%);
}

.tools-hero h1 {
    font-size: 3rem;
    line-height: 1.15;
    color: var(--text-dark);
    margin-bottom: 1rem;
    max-width: 760px;
}

.tools-hero-description {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 720px;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.tools-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: var(--text-light);
    font-weight: 500;
}

.tools-hero-meta i {
    color: var(--primary-color);
    margin-right: 0.4rem;
}

.tools-grid-section {
    background: var(--white);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: transparent;
    box-shadow: var(--shadow-lg);
}

.tool-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.tool-card-tag {
    display: inline-block;
    background: #fef5f1;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-card-tag-soon {
    background: #edf2f7;
    color: var(--text-lighter);
}

.tool-card h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.tool-card-cta {
    margin-top: auto;
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.tool-card:hover .tool-card-cta {
    gap: 0.7rem;
}

.tool-card-soon {
    opacity: 0.85;
    cursor: default;
}

.tool-card-soon:hover {
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    border-color: #e2e8f0;
}

.tools-store {
    background: var(--white);
    padding: 0 0 60px;
}

.tools-store-card {
    display: flex;
    gap: 1.75rem;
    align-items: center;
    background: linear-gradient(135deg, #fff 0%, #fef5f1 100%);
    border: 1px solid #fbd6c5;
    border-radius: 18px;
    padding: 2.25rem;
    box-shadow: var(--shadow);
}

.tools-store-icon {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.tools-store-body {
    flex: 1;
    min-width: 0;
}

.tools-store-body h2 {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin: 0.5rem 0 0.75rem;
}

.tools-store-body p {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1.25rem;
    max-width: 640px;
}

.tools-store-body .btn i {
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .tools-store-card {
        flex-direction: column;
        text-align: center;
        padding: 1.75rem;
    }

    .tools-store-body p {
        margin: 0 auto 1.25rem;
    }
}

.tools-cta {
    background: var(--background-light);
}

.tools-cta-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-radius: 18px;
    padding: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
}

.tools-cta-card h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.tools-cta-card p {
    max-width: 560px;
    line-height: 1.6;
    opacity: 0.95;
}

.tools-cta-card .btn-primary {
    background: var(--white);
    color: var(--primary-color);
}

.tools-cta-card .btn-primary:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

/* ========================
   Tool detail page
   ======================== */
.tool-hero {
    margin-top: 70px;
    padding: 60px 0 30px;
    background: linear-gradient(135deg, var(--background-light) 0%, #e2e8f0 100%);
}

.tool-hero h1 {
    font-size: 2.6rem;
    line-height: 1.2;
    color: var(--text-dark);
    margin-bottom: 1rem;
    max-width: 820px;
}

.tool-hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 760px;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.tool-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
}

.tool-hero-meta i {
    color: var(--primary-color);
    margin-right: 0.4rem;
}

/* ========================
   Calculator
   ======================== */
.calculator-section {
    padding: 40px 0 80px;
    background: var(--white);
}

/* Mode switcher (basic / advanced) */
.mode-switcher {
    background: var(--background-light);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.mode-switcher-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.mode-switcher-btn i {
    color: var(--text-lighter);
    transition: var(--transition);
}

.mode-switcher-btn:hover {
    color: var(--text-dark);
}

.mode-switcher-btn.is-active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow);
}

.mode-switcher-btn.is-active i {
    color: var(--primary-color);
}

.mode-switcher-hint {
    grid-column: 1 / -1;
    margin: 0.5rem 0.5rem 0.25rem;
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* Hide fields/results marked as advanced when the form is in basic mode */
.calc-form--basic [data-mode="advanced"] {
    display: none !important;
}

.calculator-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 2.5rem;
    align-items: start;
}

.calculator-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calc-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem 1.5rem 1.25rem;
    background: var(--white);
}

.calc-fieldset legend {
    font-weight: 600;
    color: var(--text-dark);
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.calc-fieldset legend i {
    color: var(--primary-color);
}

.calc-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.calc-field:last-child {
    margin-bottom: 0;
}

.calc-field label {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.calc-help {
    color: var(--text-lighter);
    cursor: help;
    position: relative;
    display: inline-flex;
}

.calc-help[data-tip]:hover::after,
.calc-help[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: var(--white);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: normal;
    width: max-content;
    max-width: 240px;
    z-index: 5;
    box-shadow: var(--shadow);
    line-height: 1.4;
}

.calc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.calc-input-suffix {
    display: flex;
    align-items: stretch;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: var(--white);
    overflow: hidden;
    transition: var(--transition);
}

.calc-input-suffix:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(247, 80, 0, 0.15);
}

.calc-input-suffix input {
    border: none;
    outline: none;
    padding: 0.7rem 0.85rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-dark);
    width: 100%;
    background: transparent;
    -moz-appearance: textfield;
}

.calc-input-suffix input::-webkit-outer-spin-button,
.calc-input-suffix input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.calc-input-suffix span,
.calc-input-suffix .calc-prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.85rem;
    background: var(--background-light);
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 48px;
    justify-content: center;
}

.calc-input-suffix .calc-prefix {
    border-right: 1px solid #e2e8f0;
}

.calc-input-suffix span:not(.calc-prefix) {
    border-left: 1px solid #e2e8f0;
}

.calc-field select {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    background: var(--white);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    transition: var(--transition);
}

.calc-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(247, 80, 0, 0.15);
}

.calc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.calc-store-hint {
    margin-top: 0.85rem;
    padding: 0.75rem 1rem;
    background: #fef5f1;
    border: 1px dashed #fbd6c5;
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.calc-store-hint i {
    color: var(--primary-color);
    margin-top: 0.2rem;
    flex-shrink: 0;
}

.calc-store-hint a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}

.calc-store-hint a:hover {
    color: var(--secondary-color);
}

/* Results */
.calculator-results {
    position: sticky;
    top: 90px;
}

.results-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.results-header {
    padding: 1.5rem 1.5rem 0.5rem;
}

.results-header h2 {
    color: var(--text-dark);
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.results-header p {
    color: var(--text-lighter);
    font-size: 0.9rem;
}

.results-breakdown {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.results-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.45rem 0;
    color: var(--text-light);
    font-size: 0.95rem;
}

.results-line strong {
    color: var(--text-dark);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.results-line-total {
    border-top: 1px dashed #cbd5e0;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    color: var(--text-dark);
    font-weight: 600;
}

.results-line-total strong {
    color: var(--text-dark);
    font-size: 1.1rem;
}

.results-final {
    padding: 1.25rem 1.5rem 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #fef5f1 100%);
}

.results-final-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.results-final-row strong {
    color: var(--text-dark);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.results-price {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #fbd6c5;
}

.results-price span {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.05rem;
}

.results-price strong {
    color: var(--primary-color);
    font-size: 1.6rem;
    font-weight: 700;
}

.results-disclaimer {
    margin-top: 0.85rem;
    font-size: 0.85rem;
    color: var(--text-lighter);
    line-height: 1.45;
}

.results-cta {
    padding: 1.25rem 1.5rem 1.5rem;
    background: var(--background-light);
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.results-cta p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 0;
}

.results-cta-secondary {
    background: var(--white);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.results-cta-secondary:hover {
    background: var(--secondary-color);
    color: var(--white);
}

/* ========================
   How to + FAQ + Related
   ======================== */
.tool-howto {
    background: var(--background-light);
}

.howto-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    counter-reset: howto;
    padding: 0;
}

.howto-steps li {
    display: flex;
    gap: 1rem;
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.howto-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.howto-steps h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

.howto-steps p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.55;
}

.tool-faq {
    background: var(--white);
}

.faq-list {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.faq-item {
    background: var(--background-light);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    transition: var(--transition);
}

.faq-item[open] {
    background: var(--white);
    box-shadow: var(--shadow);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
    transition: var(--transition);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    margin-top: 0.85rem;
    color: var(--text-light);
    line-height: 1.65;
}

.tool-related {
    background: var(--background-light);
    text-align: center;
    padding: 80px 0;
}

.tool-related h2 {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.tool-related > .container > p {
    color: var(--text-light);
    max-width: 640px;
    margin: 0 auto 2.5rem;
    line-height: 1.65;
}

.tool-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 820px;
    margin: 0 auto 1.5rem;
    text-align: left;
}

.tool-related-card {
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.tool-related-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.tool-related-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.tool-related-card h3 {
    font-size: 1.2rem;
    color: var(--text-dark);
}

.tool-related-card p {
    color: var(--text-light);
    line-height: 1.55;
    margin-bottom: 1rem;
    flex: 1;
}

.tool-related-card .btn {
    margin-top: auto;
}

.tool-related-footer {
    margin: 1.5rem 0 0;
}

.tool-related-footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.tool-related-footer a:hover {
    color: var(--primary-color);
}

.tool-related-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* ========================
   Responsive
   ======================== */
@media (max-width: 1024px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }

    .calculator-results {
        position: static;
    }
}

@media (max-width: 768px) {
    .tools-hero,
    .tool-hero {
        padding-top: 110px;
    }

    .tools-hero h1 {
        font-size: 2.2rem;
    }

    .tool-hero h1 {
        font-size: 2rem;
    }

    .tools-cta-card {
        padding: 2rem;
    }

    .calc-fieldset {
        padding: 1.25rem 1rem 1rem;
    }

    .calc-actions {
        justify-content: stretch;
    }

    .calc-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .results-price strong {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .calc-row {
        grid-template-columns: 1fr;
    }
}
