
/* =====================================================
   TERRA FOOD - IDENTIDAD VISUAL Y ESTILOS
   Beta 0.8 - CSS organizado y responsive
===================================================== */

/* 1. VARIABLES CORPORATIVAS */
:root {
    --tf-ink: #14233b94;
    --tf-ink2: #263D60;
    --tf-coral: #EF493F;
    --tf-coral-dark: #D93631;
    --tf-amber: #FFB52E;
    --tf-cream: #FFF7ED;
    --tf-bg: #F6F7FB;
    --tf-muted: #6D7788;
    --tf-border: #E8EAF0;
    --tf-shadow: 0 14px 38px rgba(20, 35, 59, .09);
}

/* 2. CONFIGURACIÃN GENERAL */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--tf-bg);
    color: var(--tf-ink);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--tf-coral);
    text-decoration: none;
}

.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: clamp(14px, 2vw, 24px);
    padding-right: clamp(14px, 2vw, 24px);
}

/* 3. ENCABEZADO Y NAVEGACIÃN */
.tf-nav {
    background: var(--tf-cream) !important;
    border-bottom: 1px solid #F0DFCA;
    box-shadow: 0 4px 18px rgba(20, 35, 59, .08);
    padding: .55rem 0;
    min-height: 76px;
}

.tf-nav .container {
    display: flex;
    align-items: center;
}

.tf-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--tf-ink) !important;
    text-decoration: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.tf-brand img {
    display: block;
    width: clamp(105px, 13vw, 150px);
    height: 52px;
    max-width: 150px;
    max-height: 52px;
    object-fit: contain;
    background: transparent;
    border: 0;
    padding: 0;
    flex: 0 0 auto;
}

.tf-brand-copy {
    display: block;
    white-space: nowrap;
}

.tf-brand strong {
    display: block;
    color: var(--tf-ink);
    font-size: 1.08rem;
    letter-spacing: .045em;
    line-height: 1.1;
}

.tf-brand small {
    display: block;
    color: var(--tf-coral-dark);
    font-size: .61rem;
    letter-spacing: .13em;
    margin-top: 4px;
}

.tf-nav .nav-link {
    color: var(--tf-ink2) !important;
    font-weight: 600;
    padding: .65rem .8rem !important;
}

.tf-nav .nav-link:hover {
    color: var(--tf-coral) !important;
}

.tf-nav .navbar-toggler {
    border-color: rgba(20, 35, 59, .4);
    padding: .45rem .6rem;
}

.tf-nav .navbar-toggler:focus {
    box-shadow: 0 0 0 .2rem rgba(255, 181, 46, .35);
}

.tf-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2314233b' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 4. PORTADA PRINCIPAL */
.hero {
    background:
        radial-gradient(circle at 88% 12%, rgba(255, 181, 46, .25), transparent 28%),
        linear-gradient(120deg, #14233B, #263D60 70%, #EF493F);
    color: #fff;
    border-radius: clamp(16px, 2vw, 28px);
    padding: clamp(24px, 4.5vw, 58px);
    box-shadow: var(--tf-shadow);
}

.hero h1 {
    font-weight: 900;
    font-size: clamp(2rem, 4.5vw, 3.7rem);
    letter-spacing: -.045em;
    line-height: 1.04;
    overflow-wrap: anywhere;
}

.hero p {
    color: #E7EAF1;
    max-width: 650px;
    font-size: clamp(.95rem, 1.2vw, 1.08rem);
}

.hero .pill {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

/* 5. BUSCADOR */
.searchbox {
    background: #fff;
    border-radius: 18px;
    padding: clamp(9px, 1.4vw, 14px);
    box-shadow: 0 12px 32px rgba(8, 18, 38, .18);
    margin-top: 24px;
}

/* 6. TARJETAS DE RESTAURANTES */
.restaurant-card,
.form-card,
.plan-card {
    border: 1px solid var(--tf-border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--tf-shadow);
    height: 100%;
    background: #fff;
    transition: transform .2s, box-shadow .2s;
}

.restaurant-card:hover,
.plan-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 42px rgba(20, 35, 59, .14);
}

.restaurant-cover {
    display: block;
    width: 100%;
    height: clamp(145px, 18vw, 190px);
    object-fit: cover;
    background: #E9EDF5;
}

.restaurant-logo {
    display: block;
    width: 76px !important;
    height: 76px !important;
    max-width: 76px !important;
    object-fit: contain !important;
    border-radius: 17px;
    border: 4px solid #fff;
    margin-top: -38px;
    background: #fff;
    padding: 4px;
    box-shadow: 0 4px 16px rgba(20, 35, 59, .12);
}

.restaurant-card .card-body {
    padding: 0 1.1rem 1.1rem;
}

/* 7. ETIQUETAS */
.pill {
    display: inline-block;
    background: #FFF0EC;
    color: var(--tf-coral-dark);
    border-radius: 30px;
    padding: 6px 12px;
    font-size: .78rem;
    font-weight: 700;
}

/* 8. BOTONES */
.btn-primary {
    background: var(--tf-coral);
    border-color: var(--tf-coral);
    font-weight: 700;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--tf-coral-dark);
    border-color: var(--tf-coral-dark);
}

.btn-warning {
    background: var(--tf-amber);
    border-color: var(--tf-amber);
    color: var(--tf-ink);
    font-weight: 800;
}

.btn-outline-success {
    color: var(--tf-coral);
    border-color: var(--tf-coral);
}

.btn-outline-success:hover {
    background: var(--tf-coral);
    border-color: var(--tf-coral);
    color: #fff;
}

/* 9. FORMULARIOS */
.form-card .card-body {
    padding: clamp(20px, 4vw, 38px);
}

.form-control,
.form-select {
    border-color: #DFE3EB;
    border-radius: 11px;
    padding: .72rem .9rem;
    min-width: 0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--tf-coral);
    box-shadow: 0 0 0 .2rem rgba(239, 73, 63, .12);
}

.form-label {
    font-weight: 650;
    color: var(--tf-ink2);
}

.muted {
    color: var(--tf-muted);
}

/* 10. PLANES */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.plan-option {
    display: block;
    height: 100%;
    cursor: pointer;
    min-width: 0;
}

.plan-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.plan-option .plan-card {
    padding: 20px;
    position: relative;
}

.plan-option input:checked + .plan-card {
    border: 2px solid var(--tf-coral);
    box-shadow: 0 0 0 4px rgba(239, 73, 63, .1), var(--tf-shadow);
}

.plan-price {
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    font-weight: 900;
    letter-spacing: -.04em;
    color: var(--tf-ink);
    overflow-wrap: anywhere;
}

.plan-ribbon {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #FFF0CE;
    color: #8A5700;
    padding: 4px 9px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 800;
}

.plan-free {
    background: var(--tf-cream);
    border: 1px dashed #F0C16E;
}

/* 11. PANEL ADMINISTRATIVO */
.admin-sidebar {
    background: var(--tf-ink);
    min-height: 100vh;
    color: #fff;
}

.table td,
.table th {
    vertical-align: middle;
}

/* 12. PIE DE PÃGINA */
.tf-footer {
    background: var(--tf-ink);
    color: #fff;
}

.tf-footer-logo {
    display: block;
    width: clamp(100px, 12vw, 140px);
    height: 48px;
    max-width: 140px;
    object-fit: contain;
    background: transparent;
}

/* 13. PÃGINA PRINCIPAL */
.tf-home {
    max-width: 1140px;
}

.tf-home .row {
    --bs-gutter-x: 1.5rem;
}

.tf-home .d-flex {
    min-width: 0;
}

/* 14. TABLETS Y PORTÃTILES */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (max-width: 991.98px) {
    .tf-nav .navbar-collapse {
        padding: 12px 0 6px;
    }

    .tf-nav .navbar-nav {
        align-items: stretch !important;
    }

    .tf-nav .nav-link {
        padding: .65rem .25rem !important;
    }

    .tf-nav .btn {
        width: 100%;
        margin: .35rem 0 !important;
    }

    .plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* 15. CELULARES */
@media (max-width: 575.98px) {
    .tf-nav {
        min-height: 66px;
    }

    .tf-brand {
        gap: 8px;
    }

    .tf-brand img {
        width: 90px;
        height: 42px;
        max-width: 90px;
        max-height: 42px;
    }

    .tf-brand strong {
        font-size: 15px;
    }

    .tf-brand small {
        font-size: 9px;
        letter-spacing: .09em;
    }

    .hero {
        border-radius: 16px;
        padding: 24px 18px;
    }

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

    .searchbox {
        border-radius: 14px;
    }

    .plan-grid {
        grid-template-columns: 1fr;
    }

    .restaurant-card .card-body {
        padding: 0 14px 16px;
    }

    .tf-footer-logo {
        width: 100px;
        height: 40px;
    }
}


/* =========================================
   PERFIL DE RESTAURANTE Y GALERÃA - TERRA FOOD
========================================= */
.tf-profile {max-width:1180px;}
.tf-profile-hero,.tf-profile-panel {background:#fff;border:1px solid var(--tf-border);border-radius:22px;box-shadow:var(--tf-shadow);overflow:hidden;}
.tf-profile-cover {display:block;width:100%;height:clamp(190px,28vw,340px);object-fit:cover;background:#e9edf5;}
.tf-profile-heading {display:flex;align-items:center;gap:18px;padding:0 26px 24px;flex-wrap:wrap;}
.tf-profile-logo {width:104px;height:104px;object-fit:contain;background:#fff;border:5px solid #fff;border-radius:22px;box-shadow:0 5px 20px rgba(20,35,59,.15);margin-top:-48px;position:relative;}
.tf-profile-title {flex:1;min-width:200px;padding-top:14px;}
.tf-profile-title h1 {font-size:clamp(1.65rem,3vw,2.4rem);font-weight:850;letter-spacing:-.04em;margin:8px 0 4px;color:#14233b;}
.tf-profile-contact {font-weight:750;padding:12px 22px;}
.tf-profile-panel {padding:clamp(18px,3vw,28px);margin-bottom:0;}
.tf-profile-panel h2 {font-size:1.35rem;font-weight:800;color:#14233b;margin:5px 0 18px;}
.tf-section-kicker {font-size:.7rem;font-weight:850;letter-spacing:.13em;color:var(--tf-coral);}
.tf-product-card {border:1px solid #e9edf3;border-radius:16px;padding:17px;display:flex;flex-direction:column;justify-content:space-between;transition:.2s;background:#fff;}
.tf-product-card:hover {border-color:#f4aaa5;transform:translateY(-2px);box-shadow:0 9px 24px rgba(20,35,59,.08);}
.tf-product-card h3 {font-size:1.02rem;font-weight:800;color:#263d60;margin:0 0 7px;}
.tf-product-card p {font-size:.88rem;color:#6d7788;margin:0;}
.tf-product-price {font-size:1.15rem;font-weight:900;color:#ef493f;margin-top:15px;}
.tf-product-price small {font-size:.65rem;color:#7b8492;font-weight:700;}
.tf-menu-gallery {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.tf-menu-gallery a {display:block;overflow:hidden;border-radius:14px;background:#f0f2f6;aspect-ratio:4/3;}
.tf-menu-gallery img {width:100%;height:100%;object-fit:cover;transition:transform .25s;}
.tf-menu-gallery a:hover img {transform:scale(1.045);}
.tf-contact-panel {position:sticky;top:20px;}
.tf-info-line {display:flex;gap:13px;padding:14px 0;border-bottom:1px solid #edf0f4;}
.tf-info-line>i {color:var(--tf-coral);font-size:1.05rem;width:20px;padding-top:3px;}
.tf-info-line div {display:flex;flex-direction:column;gap:3px;min-width:0;}
.tf-info-line small {color:#7a8493;font-size:.75rem;}
.tf-info-line strong {font-size:.9rem;color:#263d60;overflow-wrap:anywhere;}
.tf-empty-state {background:#f8f9fb;border:1px dashed #dce1e9;border-radius:14px;padding:28px;text-align:center;color:#7b8492;}
.tf-empty-state i {font-size:1.7rem;color:#ef493f;margin-bottom:10px;}
.tf-empty-state p {margin:0;}
.tf-product-entry {height:100%;padding:17px;background:#fff;border:1px solid #e7eaf0;border-radius:16px;}
.tf-limit-badge {background:#fff0ec;color:#d93631;border-radius:30px;padding:7px 13px;font-weight:800;font-size:.78rem;}
.tf-menu-preview {display:grid;grid-template-columns:repeat(auto-fill,minmax(110px,1fr));gap:10px;}
.tf-menu-preview img {width:100%;height:100px;object-fit:cover;border-radius:12px;border:1px solid #e5e8ee;}
@media(max-width:767px){
 .tf-profile-heading {padding:0 17px 20px;gap:12px;}
 .tf-profile-logo {width:82px;height:82px;margin-top:-35px;}
 .tf-profile-title {min-width:calc(100% - 100px);padding-top:8px;}
 .tf-profile-contact {width:100%;}
 .tf-menu-gallery {grid-template-columns:repeat(2,minmax(0,1fr));}
 .tf-contact-panel {position:static;}
}


/* =========================================
   FIX DEFINITIVO PERFIL PUBLICO RESTAURANTE
   Beta 1.0 - control de dimensiones de imagen
========================================= */
.tf-profile {
    width: 100%;
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: hidden;
}
.tf-profile .tf-profile-hero {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: 22px;
}
.tf-profile .tf-profile-cover {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: clamp(190px, 28vw, 340px) !important;
    min-height: 190px;
    object-fit: cover !important;
    object-position: center center;
}
.tf-profile .tf-profile-heading {
    display: flex !important;
    width: 100%;
    min-width: 0;
    align-items: center;
    gap: 18px;
    padding: 0 26px 24px;
    flex-wrap: wrap;
}
.tf-profile .tf-profile-logo {
    display: block !important;
    width: 104px !important;
    min-width: 104px !important;
    max-width: 104px !important;
    height: 104px !important;
    min-height: 104px !important;
    max-height: 104px !important;
    object-fit: contain !important;
    object-position: center;
    background: #fff;
    border: 5px solid #fff;
    border-radius: 22px;
    box-shadow: 0 5px 20px rgba(20,35,59,.15);
    margin-top: -48px;
    position: relative;
}
.tf-profile .tf-profile-title {
    flex: 1 1 220px;
    min-width: 0;
    overflow-wrap: anywhere;
}
.tf-profile .tf-profile-contact {
    flex: 0 0 auto;
}
.tf-profile .tf-menu-gallery {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}
.tf-profile .tf-menu-gallery a {
    display: block !important;
    width: 100%;
    min-width: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 14px;
}
.tf-profile .tf-menu-gallery img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}
@media (max-width: 767.98px) {
    .tf-profile .tf-profile-cover {
        height: 210px !important;
    }
    .tf-profile .tf-profile-heading {
        padding: 0 16px 20px;
        gap: 12px;
    }
    .tf-profile .tf-profile-logo {
        width: 82px !important;
        min-width: 82px !important;
        max-width: 82px !important;
        height: 82px !important;
        min-height: 82px !important;
        max-height: 82px !important;
        margin-top: -35px;
    }
    .tf-profile .tf-profile-title {
        flex-basis: calc(100% - 100px);
    }
    .tf-profile .tf-profile-contact {
        width: 100%;
    }
    .tf-profile .tf-menu-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 380px) {
    .tf-profile .tf-menu-gallery {
        grid-template-columns: 1fr;
    }
}


/* TERRA FOOD: catálogo y fotografías integrados en una sola sección */
.tf-menu-gallery-wrap {
    border-top: 1px solid #edf0f4;
}
.tf-menu-gallery-title {
    color: #14233b;
    font-size: 1.12rem;
    font-weight: 800;
    margin-top: 5px;
}
.tf-profile .tf-menu-gallery a {
    aspect-ratio: 4 / 3;
    background: #f5f6f8;
}
.tf-profile .tf-menu-gallery img {
    object-fit: contain !important;
    padding: 8px;
    background: #fff;
}

/* Fotografías individuales integradas a cada producto */
.tf-public-product-image {
    width: 100%;
    height: 190px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    border-radius: 14px 14px 0 0;
}
.tf-public-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Beta 1.4: imágenes asociadas a cada producto */
.tf-product-thumb {
    display:block;
    width:100%;
    max-width:150px;
    height:110px;
    object-fit:contain;
    padding:6px;
    border:1px solid #e5e7eb;
    border-radius:12px;
    background:#fff;
}
.tf-public-product-image {
    width:100%;
    height:190px;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#fff;
    border-radius:14px 14px 0 0;
}
.tf-public-product-image img {
    width:100%;
    height:100%;
    object-fit:contain;
    padding:8px;
}
