﻿/* tmBizEdit.scoped.css
   Mobile-friendly, prerender-safe styles scoped a #tmBizEditPage.
*/

/* Root / variables */
#tmBizEditPage {
    --tm-primary: #ff7b00;
    --tm-primary-2: #ff9d4a;
    --tm-muted: #6c757d;
    --tm-border: rgba(0,0,0,0.06);
    --tm-radius: 12px;
    --accent-products: #ff7b00;
    --accent-whats: #25D366;
    --accent-bank: #1E88E5;
    --accent-info: #7C4DFF;
    --accent-view: #9E9E9E;
    --surface: #ffffff;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #212529;
    padding-bottom: 3.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduced motion: respect user preference */
@media (prefers-reduced-motion: reduce) {
    #tmBizEditPage *, #tmBizEditPage *::before, #tmBizEditPage *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Breadcrumb */
#tmBizEditPage .tm-breadcrumb {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .6rem;
}

    #tmBizEditPage .tm-breadcrumb ol {
        list-style: none;
        display: flex;
        gap: .5rem;
        margin: 0;
        padding: 0;
        align-items: center;
    }

        #tmBizEditPage .tm-breadcrumb ol li {
            color: #7a7a7a;
            font-size: .9rem;
        }

#tmBizEditPage .tm-plan-badge {
    background: linear-gradient(90deg,var(--tm-primary),var(--tm-primary-2));
    color: #fff;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .85rem;
    box-shadow: 0 6px 18px rgba(255,123,0,0.12);
}

/* HERO */
#tmBizEditPage .biz-hero {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg,var(--tm-primary),var(--tm-primary-2));
    color: #fff;
    padding: 1.05rem 1.25rem;
    border-radius: var(--tm-radius);
    box-shadow: 0 12px 36px rgba(31,27,22,0.08);
    border: 1px solid rgba(255,255,255,0.06);
}

    #tmBizEditPage .biz-hero h2 {
        margin: 0;
        font-weight: 700;
        font-size: 1.25rem;
    }

    #tmBizEditPage .biz-hero .small {
        opacity: .95;
        font-size: .9rem;
    }

/* Avatar */
#tmBizEditPage .biz-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 1.3rem;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

/* Hero actions responsive behavior: make them stacked on small screens */
#tmBizEditPage .hero-actions {
    gap: .5rem;
}

@media (max-width:575.98px) {
    #tmBizEditPage .hero-actions {
        width: 100%;
        justify-content: center;
        flex-direction: column;
    }

        #tmBizEditPage .hero-actions .btn {
            width: 100%;
        }
}

/* Buttons */
#tmBizEditPage .btn {
    border-radius: 10px;
    font-weight: 700;
    transition: transform .12s ease, box-shadow .12s ease;
}

#tmBizEditPage .btn-primary {
    background: linear-gradient(90deg,var(--tm-primary),var(--tm-primary-2)) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 8px 28px rgba(255,123,0,0.10);
    padding: .42rem .85rem;
    border-radius: 10px;
    font-weight: 800;
}

#tmBizEditPage .btn-ghost {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.07);
    padding: .35rem .65rem;
    border-radius: 10px;
    font-weight: 700;
}

    #tmBizEditPage .btn-ghost:hover {
        filter: brightness(.98);
        transform: translateY(-1px);
    }

/* Card base (with left pseudo-bar room) */
#tmBizEditPage .tm-card-elevated {
    position: relative;
    overflow: visible;
    border-radius: var(--tm-radius);
    background: var(--surface);
    border: 1px solid var(--tm-border);
    box-shadow: 0 8px 28px rgba(20,20,20,0.04);
    transition: transform .12s ease, box-shadow .12s ease;
    margin-bottom: .9rem;
    padding-left: 1.2rem;
}

    #tmBizEditPage .tm-card-elevated:hover {
        transform: translateY(-4px);
        box-shadow: 0 18px 44px rgba(20,20,20,0.08);
    }

    #tmBizEditPage .tm-card-elevated .card-header {
        padding: .85rem 1rem;
        font-weight: 800;
        font-size: .95rem;
        letter-spacing: .2px;
        border-bottom: 1px solid rgba(0,0,0,0.04);
        display: flex;
        align-items: center;
        gap: .6rem;
        background: linear-gradient(180deg, rgba(245,245,245,0.6), rgba(255,255,255,0.3));
    }

/* Left pseudo-bar for sections */
#tmBizEditPage #tmBizProductsSection::before,
#tmBizEditPage #tmBizWhatsCard::before,
#tmBizEditPage #tmBizBankCard::before,
#tmBizEditPage #tmBizInfoCard::before,
#tmBizEditPage #tmBizViewCard::before,
#tmBizEditPage #tmBizPhotoCard::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 10px;
    bottom: 10px;
    width: 10px;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    z-index: 2;
}

/* Accent colors + gentle background tint per section */
#tmBizEditPage #tmBizProductsSection::before {
    background: var(--accent-products);
}

#tmBizEditPage #tmBizProductsSection {
    background: linear-gradient(180deg, rgba(255,123,0,0.02), rgba(255,123,0,0.004));
}

#tmBizEditPage #tmBizWhatsCard::before {
    background: var(--accent-whats);
}

#tmBizEditPage #tmBizWhatsCard {
    background: linear-gradient(180deg, rgba(37,211,102,0.02), rgba(37,211,102,0.004));
}

#tmBizEditPage #tmBizBankCard::before {
    background: var(--accent-bank);
}

#tmBizEditPage #tmBizBankCard {
    background: linear-gradient(180deg, rgba(30,136,229,0.02), rgba(30,136,229,0.004));
}

#tmBizEditPage #tmBizInfoCard::before {
    background: var(--accent-info);
}

#tmBizEditPage #tmBizInfoCard {
    background: linear-gradient(180deg, rgba(124,77,255,0.02), rgba(124,77,255,0.004));
}

#tmBizEditPage #tmBizViewCard::before,
#tmBizEditPage #tmBizPhotoCard::before {
    background: var(--accent-view);
}

#tmBizEditPage #tmBizViewCard,
#tmBizEditPage #tmBizPhotoCard {
    background: linear-gradient(180deg, rgba(158,158,158,0.02), rgba(158,158,158,0.004));
}

/* Ensure card body is above pseudo bar */
#tmBizEditPage .tm-card-elevated .card-body {
    position: relative;
    z-index: 3;
    padding: 1rem 1rem;
}

/* Hide pseudo-bars on very small screens to avoid layout clutter */
@media (max-width:575.98px) {
    #tmBizEditPage .tm-card-elevated::before {
        display: none;
    }

    #tmBizEditPage .tm-card-elevated {
        padding-left: .9rem;
    }
}

/* small decorative chip in headers */
#tmBizEditPage .tm-card-elevated .card-header::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: .5rem;
    border-radius: 2px;
    opacity: .95;
}

#tmBizEditPage #tmBizProductsSection .card-header::after {
    background: var(--accent-products);
}

#tmBizEditPage #tmBizWhatsCard .card-header::after {
    background: var(--accent-whats);
}

#tmBizEditPage #tmBizBankCard .card-header::after {
    background: var(--accent-bank);
}

#tmBizEditPage #tmBizInfoCard .card-header::after {
    background: var(--accent-info);
}

#tmBizEditPage #tmBizViewCard .card-header::after,
#tmBizEditPage #tmBizPhotoCard .card-header::after {
    background: var(--accent-view);
}

/* Inputs */
#tmBizEditPage .form-control-sm {
    padding: .5rem .65rem;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    transition: box-shadow .12s ease, border-color .12s ease, transform .08s ease;
    font-size: .95rem;
    background: #fff;
}

    #tmBizEditPage .form-control-sm:focus {
        box-shadow: 0 6px 20px rgba(31,123,255,0.06), 0 0 0 .04rem rgba(31,123,255,0.12);
        outline: none;
        border-color: rgba(31,123,255,0.9);
        transform: translateY(-1px);
    }

/* File input */
#tmBizEditPage input[type="file"] {
    border: 1px dashed rgba(0,0,0,0.06);
    padding: .45rem;
    border-radius: 10px;
    background: linear-gradient(180deg,#fff,#fafafa);
}

/* Photo area */
#tmBizEditPage .biz-photo-wrapper {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
    background: linear-gradient(180deg,#fff,#fbfbfb);
    display: block;
    height: 300px;
}

#tmBizEditPage .biz-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#tmBizEditPage .biz-no-photo {
    height: 260px;
    border-radius: 8px;
    border: 1px dashed rgba(0,0,0,0.04);
    background: linear-gradient(180deg,#fbfbfb,#fff);
    color: var(--tm-muted);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* focus-within: subtle colored ring per section (UX) */
#tmBizEditPage #tmBizProductsSection:focus-within .form-control-sm,
#tmBizEditPage #tmBizProductsSection:focus-within .form-control {
    box-shadow: 0 6px 20px rgba(255,123,0,0.06);
    border-color: rgba(255,123,0,0.6);
}

#tmBizEditPage #tmBizWhatsCard:focus-within .form-control-sm,
#tmBizEditPage #tmBizWhatsCard:focus-within .form-control {
    box-shadow: 0 6px 20px rgba(37,211,102,0.06);
    border-color: rgba(37,211,102,0.6);
}

#tmBizEditPage #tmBizBankCard:focus-within .form-control-sm,
#tmBizEditPage #tmBizBankCard:focus-within .form-control {
    box-shadow: 0 6px 20px rgba(30,136,229,0.06);
    border-color: rgba(30,136,229,0.6);
}

#tmBizEditPage #tmBizInfoCard:focus-within .form-control-sm,
#tmBizEditPage #tmBizInfoCard:focus-within .form-control {
    box-shadow: 0 6px 20px rgba(124,77,255,0.06);
    border-color: rgba(124,77,255,0.6);
}

/* ProductCreate (restored friendly look) */
#tmBizEditPage .tm-newproduct-scope .product-create-card {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(20,20,20,0.06);
    border: none;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--tm-border);
}

    #tmBizEditPage .tm-newproduct-scope .product-create-card .card-header {
        background: linear-gradient(90deg, var(--tm-primary), var(--tm-primary-2));
        color: #fff;
        padding: 14px 18px;
        font-weight: 700;
    }

    #tmBizEditPage .tm-newproduct-scope .product-create-card .form-control,
    #tmBizEditPage .tm-newproduct-scope .product-create-card .form-control-sm {
        border-radius: 10px;
        border: 1px solid #e9e9e9;
        padding: 10px 12px;
    }

    #tmBizEditPage .tm-newproduct-scope .product-create-card .btn-primary {
        background: linear-gradient(90deg, var(--tm-primary), var(--tm-primary-2)) !important;
        border: none !important;
        box-shadow: 0 8px 22px rgba(255,123,0,0.12);
        color: #fff !important;
        padding: .5rem .9rem;
        font-weight: 700;
    }

        #tmBizEditPage .tm-newproduct-scope .product-create-card .btn-primary:hover {
            filter: brightness(.96);
            transform: translateY(-1px);
        }

/* micro helpers */
#tmBizEditPage .fa-regular, #tmBizEditPage .fa-solid {
    vertical-align: middle;
}

#tmBizEditPage .small.text-muted {
    color: var(--tm-muted);
}

#tmBizEditPage .btn-sm {
    padding: .35rem .65rem;
    font-size: .86rem;
    border-radius: 10px;
}

#tmBizEditPage .text-danger {
    font-size: .9rem;
}

#tmBizEditPage .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: .12rem;
}

/* Responsive tweaks */
@media (max-width:991.98px) {
    #tmBizEditPage .biz-hero {
        flex-direction: column;
        text-align: center;
        gap: .6rem;
    }

    #tmBizEditPage .biz-avatar {
        width: 48px;
        height: 48px;
        border-radius: 10px;
        font-size: 1.1rem;
    }

    #tmBizEditPage .hero-actions {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile tweaks: stack columns, enlarge touch targets and make buttons full width when appropriate */
@media (max-width:575.98px) {
    #tmBizEditPage .row.g-4 {
        gap: .9rem;
    }

    #tmBizEditPage aside.col-lg-5, #tmBizEditPage main.col-lg-7 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    #tmBizEditPage .card {
        margin-bottom: .7rem;
    }

    #tmBizEditPage .biz-hero h2 {
        font-size: 1.05rem;
    }

    #tmBizEditPage .biz-photo-wrapper {
        height: 220px;
    }
    /* make primary action in each section full width for comfortable tapping */
    #tmBizEditPage .tm-card-elevated .card-body .btn-primary,
    #tmBizEditPage .tm-card-elevated .card-body .btn-outline-primary {
        width: 100%;
        display: block;
    }
    /* make small action buttons (ghost) full width too when stacked */
    #tmBizEditPage .hero-actions .btn-ghost {
        width: 100%;
    }
}

/* ==== Mobile refinements (overflow + buttons) ==== */
#tmBizEditPage {
    overflow-x: hidden; /* protección ante desbordes */
}

#tmBizEditPage .prod-head {
    column-gap: 1rem;
}

#tmBizEditPage .prod-actions {
    display: flex;
    flex-wrap: nowrap;
}

#tmBizEditPage .prod-actions .btn,
#tmBizEditPage .prod-actions a {
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Evitar que el largo del input file empuje el layout */
#tmBizEditPage .file-import-row {
    max-width: 100%;
}

#tmBizEditPage .import-file-input {
    min-width: 160px;
}

/* Code block: evitar que cause scroll global */
#tmBizEditPage .code-block {
    max-width: 100%;
    overflow-x: auto;
    padding: .35rem .5rem;
    background: #f8f9fa;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 6px;
}

#tmBizEditPage .code-block code {
    font-size: .7rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* Botones productos en XS -> ocupar ancho sin desbordar */
@media (max-width:575.98px) {
    #tmBizEditPage .prod-head {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }

    #tmBizEditPage .prod-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: .5rem;
    }

    #tmBizEditPage .prod-actions .btn,
    #tmBizEditPage .prod-actions a {
        flex: 1 1 48%;
        text-align: center;
    }

    /* Si se ve muy apretado, acortar aún más tipografía */
    #tmBizEditPage .prod-actions .btn,
    #tmBizEditPage .prod-actions a {
        font-size: .78rem;
        padding: .45rem .55rem;
    }
}

/* Evitar salto de “Nuevo producto” */
#tmBizEditPage .no-wrap {
    white-space: nowrap;
}

/* Ajustar visibilidad de “Obtener plantilla” si el gradiente del hero afecta contraste */
#tmBizEditPage .plantilla-btn {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    color: #444 !important;
}

#tmBizEditPage .plantilla-btn:hover {
    background: #f2f2f2;
}

/* Accessibility focus-visible */
#tmBizEditPage a:focus-visible, #tmBizEditPage button:focus-visible, #tmBizEditPage input:focus-visible {
    outline: 3px solid rgba(255,123,0,0.18);
    outline-offset: 2px;
    border-radius: 8px;
}

/* === Secciones más distinguibles en móvil (sin sobrecargar) === */
#tmBizEditPage .tm-card-elevated[data-sec] .sec-ico {
    font-size: 1rem;
    opacity: .9;
    display: inline-block;
    margin-right: .35rem;
}

/* Colores por sección (variable unificada) */
#tmBizEditPage .tm-card-elevated[data-sec=products] { --sec-color: var(--accent-products); }
#tmBizEditPage .tm-card-elevated[data-sec=whats]    { --sec-color: var(--accent-whats); }
#tmBizEditPage .tm-card-elevated[data-sec=bank]     { --sec-color: var(--accent-bank); }
#tmBizEditPage .tm-card-elevated[data-sec=info]     { --sec-color: var(--accent-info); }
#tmBizEditPage .tm-card-elevated[data-sec=view]     { --sec-color: var(--accent-view); }
#tmBizEditPage .tm-card-elevated[data-sec=photo]    { --sec-color: var(--accent-view); }

#tmBizEditPage .tm-card-elevated[data-sec] .sec-ico {
    color: var(--sec-color);
}

@media (max-width:575.98px) {
    /* Franja superior en lugar de la barra lateral eliminada */
    #tmBizEditPage .tm-card-elevated[data-sec] {
        border-top: 4px solid var(--sec-color);
        padding-top: .35rem;
        box-shadow: 0 4px 18px rgba(0,0,0,0.05);
    }

    /* Header ligeramente comprimido y contraste claro */
    #tmBizEditPage .tm-card-elevated[data-sec] .card-header {
        background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.00));
        padding-top: .55rem;
        padding-bottom: .55rem;
    }

    /* Realce suave al hacer focus dentro de la sección */
    #tmBizEditPage .tm-card-elevated[data-sec]:focus-within {
        outline: 2px solid rgba(var(--focus-rgb,255,123,0), .18);
        outline-offset: 2px;
    }
}

/* Micro separación visual entre secciones en XS */
@media (max-width:575.98px) {
    #tmBizEditPage .tm-card-elevated[data-sec] + .tm-card-elevated[data-sec] {
        margin-top: .65rem;
    }
}

/* Accesibilidad: refuerzo de foco en ícono si alguien navega con tab + enter */
#tmBizEditPage .tm-card-elevated[data-sec] .card-header:focus-within .sec-ico {
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.25));
}
