/* TECNOMEDIC Tienda: ajustes propios (carrito, menú móvil, buscador). Se carga después de tienda-ortopedia.css */

html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; }
[hidden] { display: none !important; }

/* Carrito lateral abierto/cerrado */
#tienda-carrito.tm-open { transform: translateX(0) !important; }
#tienda-overlay.tm-open { opacity: 1 !important; pointer-events: auto !important; }

/* Contador del carrito en el encabezado */
.tm-cart-badge {
    position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9999px; background: #E53935; color: #fff; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* Menú móvil: el nav se despliega debajo del encabezado */
@media (max-width: 767px) {
    #tienda-nav.tm-nav-open {
        display: flex !important; flex-direction: column; align-items: flex-start; gap: 14px;
        position: absolute; top: 100%; left: 0; right: 0; padding: 18px 20px;
        background: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .12);
    }
}

/* Sin resultados */
.tm-empty { padding: 48px 12px; text-align: center; font-size: 14px; color: #6b7280; }

/* Productos dentro del carrito */
.tm-cart-list { flex: 1; overflow-y: auto; padding: 8px 20px; }
.tm-cart-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.tm-cart-item img { width: 64px; height: 64px; object-fit: contain; background: #F7FBF3; border-radius: 8px; padding: 4px; flex-shrink: 0; }
.tm-cart-info { flex: 1; min-width: 0; }
.tm-cart-name { font-size: 13px; font-weight: 700; color: #1f2937; line-height: 1.3; }
.tm-cart-price { margin-top: 2px; font-size: 13px; color: #6b7280; }
.tm-cart-qty { margin-top: 8px; display: inline-flex; align-items: center; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.tm-cart-qty button { width: 28px; height: 28px; border: none; background: #fff; cursor: pointer; font-size: 15px; color: #374151; }
.tm-cart-qty button:hover { background: #f3f4f6; }
.tm-cart-qty span { min-width: 28px; text-align: center; font-size: 13px; font-weight: 600; }
.tm-cart-remove { border: none; background: none; color: #9ca3af; cursor: pointer; font-size: 18px; align-self: flex-start; }
.tm-cart-remove:hover { color: #E53935; }
.tm-cart-footer { border-top: 1px solid #e5e7eb; padding: 16px 20px 20px; }
.tm-cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: #374151; }
.tm-cart-total strong { font-size: 20px; color: #111827; }
.tm-cart-checkout {
    display: block; margin-top: 14px; text-align: center; padding: 12px; border-radius: 8px;
    background: rgb(76, 175, 80); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
}
.tm-cart-checkout:hover { background: #43A047; }
.tm-cart-clear { display: block; margin: 10px auto 0; border: none; background: none; color: #6b7280; font-size: 12px; cursor: pointer; text-decoration: underline; }
