/* Catálogo Web — Estilo Yopido para PosPro */
*, *::before, *::after { box-sizing: border-box; }
.hidden { display: none !important; }

.yop-body {
    margin: 0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
    background: #f5f5f7;
    line-height: 1.45;
    -webkit-tap-highlight-color: transparent;
}

.yop-main { min-height: 100vh; padding-bottom: 5.5rem; }

.yop-container { width: min(640px, 100% - 1.25rem); margin: 0 auto; }

/* Topbar fija */
.yop-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid #ebebef;
    padding: .65rem 0 .75rem;
    box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.yop-store { display: flex; align-items: center; gap: .65rem; margin-bottom: .65rem; }
.yop-store-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 10px; }
.yop-store strong { display: block; font-size: .95rem; color: #1a1a2e; }
.yop-store span { font-size: .72rem; color: #6b7280; }
.yop-search {
    width: 100%;
    padding: .7rem 1rem;
    border: none;
    border-radius: 12px;
    background: #f0f0f5;
    font-size: .95rem;
    outline: none;
}
.yop-search:focus { box-shadow: 0 0 0 2px var(--yop-primary, #e85d04); background: #fff; }

/* Pestañas categorías */
.yop-tabs-wrap {
    position: sticky;
    top: 108px;
    z-index: 90;
    background: #f5f5f7;
    padding: .5rem 0;
    transition: box-shadow .2s;
}
.yop-tabs-wrap.scrolled { box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.yop-tabs {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding: 0 .625rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.yop-tabs::-webkit-scrollbar { display: none; }
.yop-tab {
    flex-shrink: 0;
    padding: .45rem 1rem;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #4b5563;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.yop-tab.active {
    background: var(--yop-primary, #e85d04);
    color: #fff;
}

/* Banner */
.yop-content { padding: .75rem 0 1.5rem; }
.yop-banner { margin-bottom: 1rem; }
.yop-banner h1 { margin: 0 0 .25rem; font-size: 1.2rem; }
.yop-banner p { margin: 0; font-size: .85rem; color: #6b7280; }
.yop-count { font-size: .75rem; color: #9ca3af; }

/* Secciones por categoría */
.yop-section { margin-bottom: 1.25rem; }
.yop-section.hidden { display: none; }
.yop-section-title {
    margin: 0 0 .5rem;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    padding-left: .15rem;
}
.yop-list {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Fila producto — imagen | nombre + medida + precio | agregar */
.yop-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .6rem .65rem;
    min-height: 56px;
    border-bottom: 1px solid #f3f4f6;
    transition: background .2s;
}
.yop-row:last-child { border-bottom: none; }
.yop-row.hidden { display: none; }
.yop-row.in-cart { background: #fffaf5; }
.yop-row-out { opacity: .6; }

.yop-row-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f9fafb;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.yop-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yop-no-img .yop-emoji, .yop-emoji { font-size: 1.15rem; }

.yop-row-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}
.yop-row-name {
    font-size: .88rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}
.yop-row-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* Selector Medida */
.yop-medida-field {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-shrink: 0;
}
.yop-medida-label {
    font-size: .68rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}
.yop-medida-select-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.yop-medida-select-wrap::after {
    content: '';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #6b7280;
    pointer-events: none;
}
.yop-medida-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font-size: .78rem;
    font-weight: 600;
    padding: .35rem 1.75rem .35rem .55rem;
    min-width: 6.5rem;
    max-width: 9.5rem;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    line-height: 1.3;
}
.yop-medida-select:hover { border-color: #d1d5db; }
.yop-medida-select:focus {
    outline: none;
    border-color: var(--yop-primary, #e85d04);
    box-shadow: 0 0 0 3px rgba(232, 93, 4, .15);
}

.yop-price-stock {
    display: flex;
    align-items: baseline;
    gap: .45rem;
    flex-wrap: wrap;
    margin-left: auto;
}
.yop-row-price {
    font-size: .9rem;
    font-weight: 800;
    color: var(--yop-primary, #e85d04);
    white-space: nowrap;
    transition: opacity .2s, transform .2s;
}
.yop-row-price.yop-price-updating {
    opacity: .4;
    transform: scale(.96);
}
.yop-row-price.yop-muted { font-size: .75rem; color: #9ca3af; font-weight: 600; }
.yop-row-stock {
    font-size: .65rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}
.yop-row-stock.yop-stock-out { color: #dc2626; }
.yop-badge-agotado {
    font-size: .62rem;
    color: #dc2626;
    font-weight: 700;
    white-space: nowrap;
}

.yop-row-actions { flex: 0 0 auto; min-width: 36px; display: flex; justify-content: flex-end; align-items: center; }

.yop-btn-add {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: var(--yop-primary, #e85d04);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(232, 93, 4, .35);
}
.yop-btn-add:active { transform: scale(.94); }

.yop-stepper {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--yop-primary, #e85d04);
    border-radius: 10px;
    overflow: hidden;
    height: 36px;
}
.yop-step {
    width: 28px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--yop-primary, #e85d04);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.yop-step-qty {
    min-width: 24px;
    max-width: 36px;
    text-align: center;
    font-weight: 800;
    font-size: .75rem;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Barra carrito inferior */
.yop-cartbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    padding: .65rem .75rem;
    padding-bottom: max(.65rem, env(safe-area-inset-bottom));
    background: linear-gradient(transparent, rgba(0,0,0,.08) 30%);
    pointer-events: none;
}
.yop-cartbar-btn {
    pointer-events: auto;
    width: min(640px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    padding: .85rem 1.25rem;
    border: none;
    border-radius: 14px;
    background: var(--yop-primary, #e85d04);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(232, 93, 4, .45);
}
.yop-cartbar-text { font-size: 1rem; font-weight: 800; }
.yop-cartbar-meta { font-size: .85rem; opacity: .95; }
.yop-cartbar-meta em { font-style: normal; font-weight: 800; }

/* Drawer pedido */
.cat-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
}
.yop-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 92vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    z-index: 210;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,.15);
}
body.yop-drawer-open { overflow: hidden; }
.yop-drawer-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: .65rem auto 0;
}
.yop-drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #f3f4f6;
}
.yop-drawer-head h2 { margin: 0; font-size: 1.15rem; }
.yop-drawer-close {
    width: 36px; height: 36px;
    border: none; background: #f3f4f6;
    border-radius: 50%; font-size: 1.4rem; cursor: pointer;
}
.yop-drawer-body { overflow-y: auto; padding: 1rem 1.25rem 1.5rem; flex: 1; }

.yop-drawer-items { margin-bottom: .75rem; }
.yop-cart-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: .65rem 0;
    border-bottom: 1px solid #f3f4f6;
    gap: .5rem;
}
.yop-cart-line-info strong { display: block; font-size: .9rem; }
.yop-cart-line-info span { font-size: .78rem; color: #6b7280; }
.yop-cart-line-right { text-align: right; white-space: nowrap; }
.yop-cart-remove {
    display: block;
    margin: .25rem 0 0 auto;
    border: none;
    background: none;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
}
.yop-drawer-total {
    display: flex;
    justify-content: space-between;
    padding: .75rem 0;
    font-size: 1.15rem;
    border-top: 2px solid #f3f4f6;
    margin-bottom: 1rem;
}
.yop-empty-cart, .yop-empty {
    text-align: center;
    color: #9ca3af;
    padding: 2rem 1rem;
    font-size: .9rem;
}

/* Checkout */
.yop-checkout label {
    display: block;
    font-size: .78rem;
    font-weight: 700;
    color: #4b5563;
    margin: .65rem 0 .25rem;
}
.yop-checkout-lead { font-size: .85rem; color: #6b7280; margin: 0 0 .5rem; }
.yop-input {
    width: 100%;
    padding: .65rem .85rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
}
.yop-input:focus { outline: none; border-color: var(--yop-primary); }

.yop-mode-toggle { display: flex; gap: .5rem; margin-bottom: .25rem; }
.yop-mode {
    flex: 1;
    padding: .6rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
}
.yop-mode.active {
    border-color: var(--yop-primary);
    background: #fff7ed;
    color: var(--yop-primary-dark, #dc2f02);
}

.yop-pickup-info {
    margin: .5rem 0 1rem;
    padding: .75rem .9rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
}
.yop-pickup-badge {
    display: inline-block;
    font-size: .85rem;
    font-weight: 700;
    color: #166534;
}
.yop-pickup-address {
    margin: .35rem 0 0;
    font-size: .82rem;
    color: #4b5563;
    line-height: 1.4;
}

.yop-btn-wa {
    width: 100%;
    margin-top: 1rem;
    padding: .9rem;
    border: none;
    border-radius: 12px;
    background: #25d366;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
}
.yop-btn-wa:disabled { opacity: .5; cursor: not-allowed; }
.yop-btn-wa.is-loading { opacity: .85; pointer-events: none; }
.yop-btn-wa:active:not(:disabled) { transform: scale(.98); }
.yop-btn-save {
    width: 100%;
    margin-top: .5rem;
    padding: .75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #4b5563;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
}

.yop-success { text-align: center; padding: 2rem 1rem; }
.yop-success-icon {
    width: 56px; height: 56px;
    background: #25d366; color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; margin: 0 auto 1rem;
}

.yop-toast {
    position: fixed;
    bottom: 5.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: .6rem 1.2rem;
    border-radius: 999px;
    font-size: .85rem;
    z-index: 300;
    animation: yopPop .2s ease;
}
@keyframes yopPop {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.yop-admin-fab {
    position: fixed;
    top: .75rem;
    right: .75rem;
    z-index: 110;
    width: 36px; height: 36px;
    background: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    font-size: 1rem;
}

@media (max-width: 380px) {
    .yop-row { gap: .4rem; padding: .5rem .5rem; }
    .yop-row-name { font-size: .8rem; }
    .yop-medida-select { min-width: 5.5rem; max-width: 7.5rem; font-size: .72rem; }
    .yop-row-price { font-size: .82rem; }
    .yop-row-thumb { width: 36px; height: 36px; flex-basis: 36px; }
    .yop-price-stock { margin-left: 0; width: 100%; justify-content: space-between; }
}

@media (min-width: 641px) {
    .yop-cartbar { display: flex; justify-content: center; }
    .yop-drawer { left: 50%; transform: translateX(-50%); max-width: 480px; border-radius: 20px 20px 0 0; }
    .yop-row-meta { flex-wrap: nowrap; }
    .yop-medida-select { min-width: 7.5rem; max-width: 11rem; }
}