/* =====================================================
   3DCalculadora — style.css FINAL (Opción A · 1100px)
   Estructura oficial con .page + .page-card
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@400;600;700&display=swap');

:root {
    --primary: #1e3a8a;
    --violet: #8b33ff;
    --accent: #ff7b00;
    --success: #10b981;
    --danger: #dc2626;
    --muted: #6b7280;

    --bg: #f5f8ff;
    --card-bg: #ffffff;

    --radius: 14px;
    --shadow: 0 8px 25px rgba(17,24,39,0.06);

    /* ANCHO OFICIAL PARA TODA LA WEB */
    --max-width: 1100px;
}

/* =====================================================
   BASE / RESET
===================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Almarai', sans-serif;
    color: #111827;
    background: var(--bg);
    line-height: 1.6;
}

/* =====================================================
   LAYOUT PRINCIPAL
===================================================== */

.site-shell {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* ---------------------- HEADER ---------------------- */

.site-header {
    background: linear-gradient(90deg, var(--primary), var(--violet));
    box-shadow: 0 2px 10px rgba(0, 0, 0, .10);
    color: #fff;
}

.site-navbar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.site-navbar__brand a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-3dcalc {
    height: 48px;
    width: auto;
}

/* MENU */

.site-navbar__menu {
    display: flex;
    gap: 16px;
    align-items: center;
}

.link {
    color: #fff;
    opacity: .92;
    font-weight: 600;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 10px;
    transition: .18s;
}

.link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-pro {
    background: linear-gradient(90deg, var(--accent), var(--violet));
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 800;
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.btn-pro:hover {
    transform: translateY(-2px);
    opacity: .96;
}

/* =====================================================
   CONTENEDORES OFICIALES
===================================================== */

.page {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 40px 16px;
}

.page-card {
    width: 100%;
    max-width: var(--max-width);
    background: var(--card-bg);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* =====================================================
   TIPOGRAFÍA Y ESPACIADOS
===================================================== */

h1,
h2,
h3 {
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 8px;
}

.muted {
    color: var(--muted);
}

.center {
    text-align: center;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

/* =====================================================
   BOTONES
===================================================== */

.btn {
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    border: 0;
    transition: .18s;
    display: inline-block;
    text-decoration: none;
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: #173c9f;
    transform: translateY(-2px);
}

.btn--secondary {
    background: #eef2ff;
    color: var(--primary);
}

.btn--secondary:hover {
    background: #e6efff;
}

.btn-basic-secondary {
    background: #eef2ff;
    color: #111;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
}

/* =====================================================
   FORMULARIOS
===================================================== */

.form__group {
    margin-bottom: 14px;
}

.form__label {
    font-weight: 700;
    margin-bottom: 6px;
    color: #243b67;
}

.form__input,
.form select,
.form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e8f2;
    border-radius: 10px;
    background: #fff;
    transition: .12s;
}

.form__input:focus,
.form select:focus,
.form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(30, 58, 138, 0.08);
}

.form__help {
    font-size: .86rem;
    color: var(--muted);
}

/* =====================================================
   GRID
===================================================== */

.grid {
    display: grid;
    gap: 14px;
}

.grid--2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid--3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* =====================================================
   INDEX — 2 COLUMNAS
===================================================== */

.row-2col {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: space-between;
}

.col-text {
    flex: 1;
}

.col-img {
    flex: 1;
    text-align: center;
}

.col-img img {
    width: 100%;
    max-width: 420px;
}

/* =====================================================
   TIEMPO (3 selects en línea)
===================================================== */

.row-time {
    display: flex;
    gap: 10px;
}

.row-time .form__input {
    flex: 1;
}

/* =====================================================
   CAJAS INFO
===================================================== */

.info-box {
    background: #f8faff;
    border-left: 4px solid var(--primary);
    padding: 14px 18px;
    border-radius: 12px;
}

/* =====================================================
   MODALES
===================================================== */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(4px);
    z-index: 9999;
}

.modal.is-open {
    display: flex;
}

.modal__dialog {
    width: min(520px, 94vw);
    background: #fff;
    padding: 22px;
    border-radius: 16px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.25);
    animation: modalUp .25s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes modalUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-basic-title {
    font-size: 1.6rem;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 800;
    color: var(--primary);
}

/* =====================================================
   MODAL — Calculadora Básica
===================================================== */

#modalBasica .modal-basic-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    text-align: center;
    margin-bottom: 18px;
}

#modalBasica .modal-basic-label {
    font-size: 1.1rem;
    font-weight: 800;
    color: #000;
    text-align: center;
    margin-top: 10px;
}

#modalBasica .modal-basic-value-cost {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--danger);
    text-align: center;
    margin: 8px 0 14px 0;
}

#modalBasica .modal-basic-value-price {
    font-size: 2.1rem;
    font-weight: 900;
    color: var(--success);
    text-align: center;
    margin: 10px 0 16px 0;
}

#modalBasica .modal__actions-basic {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}
/* =====================================================
   HISTORIAL
===================================================== */

.card-presupuesto {
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid #e6ebf6;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    margin-bottom: 22px;
}

.card-presupuesto-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.card-item {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.card-item .label {
    min-width: 110px;
    font-weight: 700;
}

.card-notas {
    background: #fbfdff;
    border-left: 4px solid var(--primary);
    padding: 10px;
    border-radius: 8px;
    margin-top: 6px;
    white-space: pre-line;
}

.card-presupuesto-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.precio-final {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--success);
}

.card-buttons {
    display: flex;
    gap: 10px;
}

.btn-edit {
    background: #eef2ff;
    color: #4338ca;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 800;
}

.btn-edit:hover {
    background: #e6eeff;
}

.btn-delete {
    background: #ffe7ea;
    color: #b91c1c;
    padding: 8px 14px;
    border-radius: 10px;
    font-weight: 800;
}

.btn-delete:hover {
    background: #ffd5da;
}

/* =====================================================
   PANEL
===================================================== */

.panel {
    text-align: center;
    padding: 20px;
}

.panel__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary), var(--violet));
    color: #fff;
    padding: 14px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 800;
}

.panel__btn--logout {
    background: #e74c3c;
}

/* -----------------------
   PANEL - botones grandes
------------------------ */

.panel-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.panel-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--violet));
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.06);
    transition: transform .14s ease, box-shadow .14s ease, opacity .12s;
    white-space: nowrap;
}

.panel-button__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.panel-button.logout {
    background: linear-gradient(135deg, #ff5a63, #e63b2f);
    box-shadow: 0 10px 26px rgba(230, 59, 47, 0.12);
}

.panel-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.10);
    opacity: 0.98;
}

.panel-button:focus {
    outline: 3px solid rgba(30, 58, 138, 0.14);
    outline-offset: 3px;
}

/* Responsive panel buttons */

@media (min-width: 1024px) {
    .panel-buttons {
        display: grid;
        grid-template-columns: repeat(2, max-content);
        gap: 12px 18px;
        justify-content: end;
        align-items: center;
    }
}

@media (max-width: 900px) {
    .panel-buttons {
        justify-content: center;
    }

    .panel-button {
        width: 100%;
        justify-content: center;
    }

    .panel-button__icon {
        width: 36px;
        height: 36px;
    }
}

/* =====================================================
   CONFIGURACIÓN
===================================================== */

.config-section {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #e7eaf2;
}

.config-form .grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

/* =====================================================
   FOOTER
===================================================== */

.site-footer {
    margin-top: auto;
    background: linear-gradient(90deg, var(--violet), var(--primary));
    color: #fff;
    padding: 26px 18px;
    text-align: center;
}

.site-footer__links a {
    color: #fff;
    opacity: .9;
    text-decoration: none;
    margin: 0 10px;
}

.site-footer__links a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 900px) {
    .site-navbar {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .row-2col {
        flex-direction: column-reverse;
    }

    .col-img img {
        max-width: 320px;
    }

    .page {
        padding: 30px 14px;
    }

    .page-card {
        padding: 22px;
    }
}

@media (max-width: 480px) {
    .form__input {
        font-size: .95rem;
        padding: 10px;
    }

    .btn {
        padding: 10px 12px;
    }

    .precio-final {
        font-size: 1.15rem;
    }

    .page {
        padding: 20px 12px;
    }

    .page-card {
        padding: 18px;
    }
}

/* =====================================================
   LOGIN / AUTH
===================================================== */

.auth-columns {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

.auth-box {
    background: #fff;
    padding: 26px;
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(8, 30, 80, 0.06);
    flex: 1 1 420px;
    min-width: 320px;
}

.auth-list {
    list-style: none;
    margin: 12px 0 18px 0;
    padding: 0;
}

.auth-box .btn {
    display: block;
    text-align: center;
}

/* =====================================================
   CALCULADORA PROFESIONAL
===================================================== */

.calc-pro-wrapper .form__input,
.calc-pro-wrapper select,
.calc-pro-wrapper textarea {
    font-size: 1.05rem;
    padding: 12px 14px;
}

.calc-pro-wrapper h2 {
    font-size: 1.6rem;
    font-weight: 800;
}

@media (min-width: 801px) {
    .calc-pro-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px 22px;
        align-items: start;
    }

    .calc-pro-row-2 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 18px 22px;
        margin-top: 10px;
    }
}

#camposGuardar {
    display: none;
}

#guardarPresupuesto:checked ~ #camposGuardar {
    display: block;
}

#guardarPresupuesto {
    transform: scale(1.25);
}

.collapsible-box {
    cursor: pointer;
}

.collapsible-trigger {
    margin-bottom: 8px;
}

.collapsible-content p {
    margin-bottom: 8px;
}

.calc-pro-wrapper {
    margin-top: 26px;
}

.calc--pro h2 {
    margin-top: 18px;
    margin-bottom: 18px;
}

/* =====================================================
   TABLAS CONFIGURACIÓN
===================================================== */

.tabla-container {
    width: 100%;
    margin-top: 16px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.data-table th {
    background: linear-gradient(90deg, var(--primary), var(--violet));
    color: #fff;
    text-align: left;
    padding: 12px;
    font-weight: 700;
    font-size: .95rem;
}

.data-table td {
    border-bottom: 1px solid #eef2f7;
    padding: 12px;
    font-size: .95rem;
}

.data-table tr:nth-child(even) {
    background: #f9fbff;
}

.data-table tr:hover {
    background: #eef4ff;
}

.data-table button {
    border: none;
    background: #ffe6e9;
    color: #b91c1c;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.data-table button:hover {
    background: #ffccd3;
}

.config-section h3 {
    color: var(--primary);
    font-weight: 800;
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.divider {
    border: none;
    border-top: 1px solid #e5e8f4;
    margin: 25px 0;
}

.btn-add {
    background: #eef2ff;
    color: var(--primary);
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: .15s;
}

.btn-add:hover {
    background: #ddebff;
}

/* =====================================================
   MODAL FOOTER
===================================================== */

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* =====================================================
   MODAL EXTRA CONFIG
===================================================== */

.modal__dialog {
    background: #fff;
    padding: 26px;
    border-radius: 14px;
    width: min(420px, 94vw);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
    animation: modalUp .22s ease-out forwards;
    transform: translateY(12px);
    opacity: 0;
}

@keyframes modalUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* =====================================================
   FIX MODALES
===================================================== */

.modal.is-open {
    display: flex !important;
}

.modal {
    z-index: 99999 !important;
}

.modal__dialog {
    z-index: 100000 !important;
    background: #fff;
    border-radius: 16px;
    padding: 22px;
    max-width: 420px;
    width: 90%;
}

/* =====================================================
   FIX 3 COLUMNAS CALCULADORA BÁSICA
===================================================== */

.basic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    width: 100%;
}

.basic-grid .form__group {
    min-width: 0;
}

.basic-grid .row-time {
    width: 100%;
}

.basic-grid select,
.basic-grid input {
    min-width: 0;
}

/* =====================================================
   FIX ENLACES
===================================================== */

.link {
    padding: 0 !important;
}

.nav-link {
    padding: 8px 12px !important;
    border-radius: 10px;
}

/* =========================================================
   ⭐ BLOQUE: ¿Qué hace esta calculadora?
   (Aislado totalmente — no rompe nada del diseño existente)
========================================================= */

.calc-info-block {
    margin-top: 40px;
    padding: 20px 10px;
    text-align: center;
}

.calc-info-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 28px;
    color: var(--primary);
}

.calc-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 26px;
}

.calc-info-item {
    background: #fff;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    transition: transform .25s ease, box-shadow .25s ease;
}

.calc-info-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}

.calc-info-item .icon {
    font-size: 2.4rem;
    margin-bottom: 12px;

    /* Animación suave */
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}

.calc-info-item h3 {
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--primary);
}

.calc-info-item p {
    font-size: 0.95rem;
    color: var(--muted);
}

/* Responsive */
@media (max-width: 480px) {
    .calc-info-title {
        font-size: 1.5rem;
    }
}
.info-box p {
    margin-bottom: 10px;
}

.info-box p:last-child {
    margin-bottom: 0;
}

/* Cuadro estilizado para calculadora básica */
.basic-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    padding: 35px 35px 45px 35px;
    border-radius: 22px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

/* Texto gris pequeño encima del botón */
.basic-pre-note {
    text-align:center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
    margin-bottom: 12px;
}
.basic-grid-row {
    display: grid;
    gap: 22px;
    width: 100%;
}

.basic-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.basic-row-3 {
    grid-template-columns: repeat(3, 1fr);
}
/* Diseño más profesional para el modal */
.modal-basic-pro {
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.25);
}

/* Iconos */
.modal-icon {
    font-size: 1.4rem;
    margin-right: 6px;
}

.modal-line {
    text-align: center;
    margin-bottom: 18px;
}

.modal-label {
    font-weight: 800;
    color: #222;
    margin-bottom: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Caja profesional */
.modal-pro-box {
    background: #f4f6ff;
    border-left: 4px solid var(--primary);
    padding: 16px;
    margin: 22px 0;
    border-radius: 12px;
    text-align: left;
    font-size: 0.95rem;
    color: #333;
}

.modal-pro-box ul {
    margin-top: 8px;
    padding-left: 18px;
}

.modal-pro-btn {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--violet));
    color: #fff;
    padding: 12px;
    margin-top: 14px;
    border-radius: 12px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
    transition: .2s;
}

.modal-pro-btn:hover {
    transform: translateY(-2px);
    opacity: .95;
}
/* =========================================
   ARTÍCULOS SEO — TARJETAS INFORMATIVAS
========================================= */

.articulos-destacados {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
    padding: 10px;
}

.articulo-card {
    background: #ffffff;
    padding: 26px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    transition: 0.25s ease;
}

.articulo-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.10);
}

.articulo-img {
    width: 100%;
    max-width: 360px;
    display: block;
    margin: 0 auto 18px auto;
}

.articulo-titulo {
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--primary);
    text-align: center;
}

.articulo-texto {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 16px;
    text-align: justify;
}

.articulo-link {
    display: inline-block;
    margin-top: 5px;
    font-weight: 700;
    color: var(--violet);
    text-decoration: none;
}

.articulo-link:hover {
    color: #6a23d9;
    text-decoration: underline;
}

/* TITULOS MÁS GRANDES EN LA CALCULADORA (Filamento, Impresora, Etc) */
.calc-pro-wrapper .form__label {
    font-size: 1.12rem; /* antes 1.05rem */
}
/* CHECKBOX ESTILO TITULO (Guardar presupuesto / Varias piezas) */
.form__label--checkbox {
    font-size: 1.12rem;
    font-weight: 700;
    color: #243b67;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 6px;
}
/* TAMAÑO CHECKBOXES GRANDES */
.checkbox-big {
    transform: scale(1.25);
}

/* END OF FILE */
