/*
 * Home redesign.
 * Port visual tokens and layout intent from Matscann_Home_(standalone).html,
 * keeping Blade routes, Algolia products and real quotation flows.
 */

:root {
    --ms-home-amber-50: #fff9e8;
    --ms-home-amber-100: #fdf1cb;
    --ms-home-amber-300: #f8d26a;
    --ms-home-amber-400: #f5be3f;
    --ms-home-amber-500: #e8a91e;
    --ms-home-ink-900: #0e0e0e;
    --ms-home-ink-800: #1a1a1a;
    --ms-home-ink-700: #2a2a2a;
    --ms-home-ink-600: #444444;
    --ms-home-ink-500: #6b6b6b;
    --ms-home-ink-300: #c7c7c7;
    --ms-home-ink-200: #e5e5e5;
    --ms-home-ink-100: #f2f2f2;
    --ms-home-ink-50: #fafafa;
    --ms-home-cream-50: #fdfaf1;
    --ms-home-cream-100: #fbf4de;
    --ms-home-cream-200: #f8ebc2;
    --ms-home-white: #ffffff;
    --ms-home-danger: #d93d3d;
    --ms-home-radius-sm: 8px;
    --ms-home-radius-md: 14px;
    --ms-home-radius-lg: 20px;
    --ms-home-radius-xl: 28px;
    --ms-home-radius-2xl: 36px;
    --ms-home-radius-pill: 999px;
    --ms-home-shadow-sm: 0 2px 6px rgba(14, 14, 14, 0.06), 0 1px 2px rgba(14, 14, 14, 0.04);
    --ms-home-shadow-md: 0 10px 24px rgba(14, 14, 14, 0.08), 0 2px 6px rgba(14, 14, 14, 0.04);
    --ms-home-shadow-lg: 0 24px 60px rgba(14, 14, 14, 0.12), 0 6px 16px rgba(14, 14, 14, 0.06);
    --ms-home-shadow-amber: 0 18px 40px rgba(232, 169, 30, 0.35);
}

.ms-home-redesign {
    background: var(--ms-home-ink-50);
    color: var(--ms-home-ink-900);
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    overflow-x: clip;
}

.ms-home-redesign *,
.ms-home-redesign *::before,
.ms-home-redesign *::after {
    box-sizing: border-box;
}

.ms-home-redesign a {
    color: inherit;
    text-decoration: none;
}

.ms-home-redesign a:hover {
    text-decoration: none;
}

.ms-home-redesign img {
    display: block;
    max-width: 100%;
}

.ms-home-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 28px;
}

.ms-home-eyebrow {
    color: var(--ms-home-amber-500);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.ms-home-section {
    background: var(--ms-home-white);
    padding: 72px 0;
}

.ms-home-section--soft {
    background: var(--ms-home-cream-50);
}

.ms-home-section--dark {
    background: var(--ms-home-ink-900);
    color: var(--ms-home-white);
}

.ms-home-section-head {
    align-items: end;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 36px;
}

.ms-home-section-title {
    color: inherit;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.1;
    margin: 0;
    text-transform: uppercase;
}

.ms-home-section-lede {
    color: var(--ms-home-ink-600);
    font-size: 1rem;
    line-height: 1.65;
    margin: 12px 0 0;
    max-width: 650px;
}

.ms-home-section--dark .ms-home-section-lede {
    color: var(--ms-home-ink-300);
}

.ms-home-see-all,
.ms-home-btn {
    align-items: center;
    border: 0;
    border-radius: var(--ms-home-radius-pill);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 9px;
    justify-content: center;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
    white-space: nowrap;
}

.ms-home-see-all {
    color: var(--ms-home-ink-900);
    gap: 6px;
    letter-spacing: 0.08em;
    padding-bottom: 4px;
    border-bottom: 2px solid var(--ms-home-amber-400);
}

.ms-home-see-all:hover {
    border-bottom-color: var(--ms-home-ink-900);
}

.ms-home-btn {
    padding: 14px 24px;
}

.ms-home-see-all:hover,
.ms-home-btn:hover {
    transform: translateY(-1px);
}

.ms-home-btn--primary {
    background: var(--ms-home-amber-400);
    box-shadow: var(--ms-home-shadow-amber);
    color: var(--ms-home-ink-900);
}

.ms-home-btn--primary:hover {
    background: var(--ms-home-amber-500);
}

.ms-home-btn--dark {
    background: var(--ms-home-ink-900);
    color: var(--ms-home-white);
}

.ms-home-btn--outline {
    background: var(--ms-home-white);
    box-shadow: inset 0 0 0 1.5px var(--ms-home-ink-900);
    color: var(--ms-home-ink-900);
}

/* Hero */
.ms-home-hero {
    background: var(--ms-home-white);
    overflow: visible;
    position: relative;
}

.ms-home-hero__background {
    height: 100%;
    inset: 0;
    object-fit: cover;
    object-position: center;
    position: absolute;
    width: 100%;
    z-index: 1;
}

/* Velo de la variante Foto única del standalone */
.ms-home-hero__veil {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 58% 75% at 50% 48%, rgba(255,255,255,.95) 0%, rgba(255,255,255,.78) 55%, rgba(255,255,255,.1) 100%),
        linear-gradient(180deg, rgba(255,255,255,.3) 0%, rgba(255,255,255,0) 40%, rgba(255,255,255,.85) 100%);
}

/* Contenido: columna única centrada, sin container wrapper */
.ms-home-hero__inner {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 84px 28px 96px;
}

.ms-home-hero__title {
    color: var(--ms-home-ink-900);
    font-size: 52px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.08;
    margin: 0;
    max-width: 880px;
    text-transform: uppercase;
    text-wrap: balance;
}

.ms-home-hero__highlight {
    color: var(--ms-home-amber-500);
}

.ms-home-hero__subtitle {
    color: var(--ms-home-ink-700);
    font-size: 1.0625rem;
    font-weight: 500;
    line-height: 1.5;
    margin: 18px 0 0;
    max-width: 560px;
    text-wrap: pretty;
}

.ms-home-search-wrap {
    margin-top: 32px;
    max-width: 640px;
    position: relative;
    width: 100%;
}

.ms-home-search {
    position: relative;
    width: 100%;
}

/* Dropdown de sugerencias del hero */
.ms-home-suggestions {
    background: var(--ms-home-white);
    border-radius: var(--ms-home-radius-md);
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
    display: none;
    left: 0;
    max-height: 360px;
    overflow-y: auto;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 9999;
}
.ms-home-suggestions.visible { display: block; }

.ms-home-sugg-item {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    transition: background 0.15s;
}
.ms-home-sugg-item:hover,
.ms-home-sugg-item:focus { background: var(--ms-home-ink-50, #f5f5f5); outline: none; }

.ms-home-sugg-img {
    border-radius: 6px;
    flex-shrink: 0;
    height: 40px;
    object-fit: contain;
    width: 40px;
    background: var(--ms-home-ink-100, #eee);
}
.ms-home-sugg-img-placeholder {
    align-items: center;
    background: var(--ms-home-ink-100, #eee);
    border-radius: 6px;
    color: var(--ms-home-ink-400, #aaa);
    display: flex;
    flex-shrink: 0;
    font-size: 18px;
    height: 40px;
    justify-content: center;
    width: 40px;
}
.ms-home-sugg-body { min-width: 0; }
.ms-home-sugg-name {
    color: var(--ms-home-ink-900);
    font-size: 0.875rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ms-home-sugg-name em { font-style: normal; color: var(--ms-home-amber-600, #b45309); }
.ms-home-sugg-cat {
    color: var(--ms-home-ink-500);
    font-size: 0.75rem;
    margin-top: 1px;
}
.ms-home-sugg-footer {
    border-top: 1px solid var(--ms-home-ink-100, #eee);
    color: var(--ms-home-ink-600);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 10px 16px;
    text-align: center;
    text-decoration: none;
    display: block;
}
.ms-home-sugg-footer:hover { background: var(--ms-home-ink-50, #f5f5f5); color: var(--ms-home-ink-900); }

.ms-home-search__input {
    background: var(--ms-home-white);
    border: 1px solid var(--ms-home-ink-200);
    border-radius: var(--ms-home-radius-pill);
    box-shadow: var(--ms-home-shadow-md);
    color: var(--ms-home-ink-900);
    font-family: inherit;
    font-size: 1rem;
    height: 60px;
    outline: 0;
    padding: 0 150px 0 28px;
    width: 100%;
}

.ms-home-search__input::placeholder {
    color: var(--ms-home-ink-500);
}

.ms-home-search__input:focus {
    border-color: var(--ms-home-amber-400);
    box-shadow: var(--ms-home-shadow-lg);
}

.ms-home-search__button {
    align-items: center;
    background: var(--ms-home-ink-900);
    border: 0;
    border-radius: var(--ms-home-radius-pill);
    color: var(--ms-home-white);
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 8px;
    height: 46px;
    justify-content: center;
    letter-spacing: 0.07em;
    padding: 0 26px;
    position: absolute;
    right: 7px;
    text-transform: uppercase;
    top: 7px;
}

.ms-home-search__button:hover {
    background: var(--ms-home-ink-700);
}

.ms-home-search-hints {
    align-items: center;
    color: var(--ms-home-ink-600);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.78rem;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
}

.ms-home-search-hints span {
    color: var(--ms-home-ink-500);
    font-weight: 700;
}

.ms-home-search-hints a {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--ms-home-ink-200);
    border-radius: var(--ms-home-radius-pill);
    color: var(--ms-home-ink-800);
    font-weight: 700;
    padding: 5px 12px;
}

.ms-home-search-hints a:hover {
    background: var(--ms-home-white);
    border-color: var(--ms-home-amber-400);
}

/* Offers */
.ms-home-offers {
    background: var(--ms-home-ink-50);
    margin-top: -52px;
    position: relative;
    z-index: 4;
}

.ms-home-offer-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ms-home-offer-card {
    align-items: stretch;
    background: var(--ms-home-white);
    border: 1px solid var(--ms-home-ink-200);
    border-radius: var(--ms-home-radius-md);
    box-shadow: var(--ms-home-shadow-md);
    color: var(--ms-home-ink-900);
    cursor: pointer;
    display: flex;
    gap: 16px;
    padding: 14px;
    text-decoration: none;
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.ms-home-offer-card:hover {
    box-shadow: var(--ms-home-shadow-lg);
    transform: translateY(-2px);
}

.ms-home-offer-card img {
    border-radius: var(--ms-home-radius-sm);
    flex: 0 0 104px;
    height: 104px;
    object-fit: cover;
    width: 104px;
}

.ms-home-offer-card__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
    min-width: 0;
}

.ms-home-offer-card__badge {
    align-self: flex-start;
    background: var(--ms-home-amber-400);
    border-radius: 4px;
    color: var(--ms-home-ink-900);
    display: inline-flex;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.35;
    padding: 4px 9px;
    text-transform: uppercase;
}

.ms-home-offer-card h3 {
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
}

.ms-home-offer-card__price {
    color: var(--ms-home-ink-600);
    font-size: 13px;
}

.ms-home-offer-card__price strong {
    color: var(--ms-home-ink-900);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ms-home-offer-card__link {
    color: var(--ms-home-ink-900);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-transform: uppercase;
}

.ms-home-offer-card__link:hover {
    color: var(--ms-home-ink-900);
    text-decoration: underline;
}

/* Categories — compact 5×2 grid matching standalone */
.ms-home-category-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ms-home-category-card {
    background: var(--ms-home-white);
    border: 1px solid var(--ms-home-ink-200);
    border-radius: var(--ms-home-radius-md);
    color: var(--ms-home-ink-900);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 18px 20px;
    transition: box-shadow 120ms ease, border-color 120ms ease;
}

.ms-home-category-card:hover {
    border-color: var(--ms-home-amber-400);
    box-shadow: var(--ms-home-shadow-md);
    text-decoration: none;
}

.ms-home-category-card__icon {
    background: var(--ms-home-cream-100);
    border-radius: var(--ms-home-radius-sm);
    color: var(--ms-home-ink-900);
    display: grid;
    flex-shrink: 0;
    font-size: 22px;
    height: 46px;
    place-items: center;
    transition: background 120ms ease;
    width: 46px;
}

.ms-home-category-card:hover .ms-home-category-card__icon {
    background: var(--ms-home-amber-400);
}

.ms-home-category-card h3 {
    color: var(--ms-home-ink-900);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.ms-home-category-card h3 span {
    color: var(--ms-home-ink-500);
    display: block;
    font-size: 12px;
    font-weight: 400;
    margin-top: 2px;
}

/* How it works */
.ms-home-section--how {
    background: var(--ms-home-cream-50);
    border-top: 1px solid var(--ms-home-cream-200);
    border-bottom: 1px solid var(--ms-home-cream-200);
}

.ms-home-how-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ms-home-how-card {
    background: var(--ms-home-white);
    border: 1px solid var(--ms-home-ink-200);
    border-radius: var(--ms-home-radius-lg);
    padding: 28px 26px 30px;
    position: relative;
}

.ms-home-how-icon {
    background: var(--ms-home-ink-900);
    border-radius: var(--ms-home-radius-sm);
    color: var(--ms-home-amber-400);
    display: grid;
    font-size: 22px;
    height: 52px;
    margin-bottom: 18px;
    place-items: center;
    width: 52px;
}

.ms-home-how-step {
    color: var(--ms-home-amber-500);
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ms-home-how-card h3 {
    color: var(--ms-home-ink-900);
    font-size: 19px;
    font-weight: 700;
    margin: 10px 0 8px;
}

.ms-home-how-card p {
    color: var(--ms-home-ink-600);
    font-size: 14.5px;
    line-height: 1.65;
    margin: 0;
}

/* Flecha entre cards — solo en las 2 primeras, posicionada fuera del borde derecho */
.ms-home-how-arrow {
    color: var(--ms-home-ink-300);
    font-size: 18px;
    position: absolute;
    right: -18px;
    top: 54px;
    z-index: 1;
}

.ms-home-how-cta {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

/* Solutions */
.ms-home-solution-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ms-home-solution-card {
    background: var(--ms-home-ink-800);
    border: 1px solid var(--ms-home-ink-700);
    border-radius: var(--ms-home-radius-lg);
    color: var(--ms-home-white);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px 24px;
    transition: border-color 120ms ease, transform 120ms ease;
}

.ms-home-solution-card:hover {
    border-color: var(--ms-home-amber-400);
    transform: translateY(-2px);
}

.ms-home-solution-card__icon {
    color: var(--ms-home-amber-400);
    display: block;
    font-size: 28px;
    height: 40px;
    line-height: 40px;
    width: 40px;
}

.ms-home-solution-card h3 {
    color: var(--ms-home-white);
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.ms-home-solution-card p {
    color: var(--ms-home-ink-300);
    font-size: 13.5px;
    line-height: 1.5;
    margin: 0;
}

.ms-home-solution-card > span:last-child {
    align-items: center;
    color: var(--ms-home-amber-400);
    display: inline-flex;
    font-size: 11.5px;
    font-weight: 700;
    gap: 6px;
    letter-spacing: 0.08em;
    margin-top: auto;
    padding-top: 6px;
    text-transform: uppercase;
}

/* Products */
.ms-home-product-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ms-home-product-card {
    background: var(--ms-home-white);
    border: 1px solid var(--ms-home-ink-200);
    border-radius: var(--ms-home-radius-md);
    box-shadow: var(--ms-home-shadow-sm);
    color: var(--ms-home-ink-900);
    display: flex;
    flex-direction: column;
    min-height: 390px;
    padding: 14px;
    position: relative;
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.ms-home-product-card:hover {
    box-shadow: var(--ms-home-shadow-md);
    transform: translateY(-3px);
}

.ms-home-product-card__badge {
    background: var(--ms-home-ink-900);
    border-radius: 4px;
    color: var(--ms-home-amber-400);
    font-size: 10px;
    font-weight: 700;
    left: 22px;
    letter-spacing: 0.08em;
    padding: 4px 8px;
    position: absolute;
    text-transform: uppercase;
    top: 22px;
    z-index: 2;
}

.ms-home-product-card__image {
    align-items: center;
    background: var(--ms-home-ink-100);
    border-radius: var(--ms-home-radius-sm);
    display: flex;
    height: 190px;
    justify-content: center;
    overflow: hidden;
}

.ms-home-product-card__image img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ms-home-product-card__brand {
    color: var(--ms-home-ink-500);
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-top: 14px;
    text-transform: uppercase;
}

.ms-home-product-card__name {
    color: var(--ms-home-ink-900);
    display: -webkit-box;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.35;
    margin-top: 4px;
    min-height: 39px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.ms-home-product-card__price {
    color: var(--ms-home-ink-900);
    display: flex;
    flex-wrap: wrap;
    font-size: 21px;
    font-weight: 700;
    gap: 8px;
    line-height: 1.1;
    margin-top: 10px;
}

.ms-home-product-card__previous-price {
    color: var(--ms-home-ink-500);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: line-through;
}

.ms-home-product-card__unit {
    color: var(--ms-home-ink-500);
    display: block;
    font-size: 12px;
    font-weight: 400;
    margin-top: 1px;
}

.ms-home-product-card__cta {
    align-items: center;
    background: var(--ms-home-cream-100);
    border-radius: var(--ms-home-radius-pill);
    color: var(--ms-home-ink-900);
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    letter-spacing: 0.05em;
    margin-top: 14px;
    padding: 11px 0;
    text-transform: uppercase;
    width: 100%;
}

.ms-home-product-card:hover .ms-home-product-card__cta {
    background: var(--ms-home-amber-400);
}

.ms-home-empty {
    background: var(--ms-home-white);
    border: 1px dashed var(--ms-home-ink-300);
    border-radius: var(--ms-home-radius-xl);
    color: var(--ms-home-ink-600);
    display: flex;
    flex-direction: column;
    gap: 12px;
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
}

.ms-home-empty a {
    color: var(--ms-home-ink-900);
    font-weight: 700;
}

/* Advantages */
.ms-home-section--advantages {
    background: var(--ms-home-cream-50);
    border-top: 1px solid var(--ms-home-cream-200);
}

.ms-home-benefit-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ms-home-benefit-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ms-home-benefit-card > span {
    background: var(--ms-home-amber-400);
    border-radius: 50%;
    color: var(--ms-home-ink-900);
    display: grid;
    font-size: 20px;
    height: 44px;
    place-items: center;
    width: 44px;
}

.ms-home-benefit-card h3 {
    color: var(--ms-home-ink-900);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.ms-home-benefit-card p {
    color: var(--ms-home-ink-600);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* CTA */
.ms-home-cta-final {
    background: var(--ms-home-amber-400);
    color: var(--ms-home-ink-900);
}

.ms-home-cta-final .ms-home-container {
    align-items: center;
    display: flex;
    gap: 40px;
    justify-content: space-between;
    padding-bottom: 64px;
    padding-top: 64px;
}

.ms-home-cta-final h2 {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.05;
    margin: 0;
    max-width: 620px;
    text-transform: uppercase;
    text-wrap: balance;
}

.ms-home-cta-final p {
    color: var(--ms-home-ink-800);
    font-size: 16px;
    line-height: 1.5;
    margin: 14px 0 0;
    max-width: 520px;
}

.ms-home-cta-final__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.ms-home-cta-final .ms-home-btn--dark {
    background: var(--ms-home-ink-900);
    border: 1px solid var(--ms-home-ink-900);
    color: var(--ms-home-white);
}

.ms-home-cta-final .ms-home-btn--dark:hover,
.ms-home-cta-final .ms-home-btn--dark:focus {
    background: var(--ms-home-ink-700);
    color: var(--ms-home-white);
}

.ms-home-cta-final .ms-home-btn--dark i,
.ms-home-cta-final .ms-home-btn--dark svg {
    color: var(--ms-home-white);
}

/* La sección inmediatamente después del hero solapa su borde inferior */
.ms-home-section--overlaps-hero {
    margin-top: -52px;
    position: relative;
    z-index: 4;
}

@media (max-width: 1199px) {
    .ms-home-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ms-home-benefit-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    /* 5 cols → 3+2 en pantallas medias */
    .ms-home-category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .ms-home-hero__inner {
        padding: 72px 28px 88px;
    }

    .ms-home-offers {
        margin-top: -36px;
    }

    /* En tablet una sola columna desperdicia ~700px de ancho y estira la
       pagina; dos columnas entran cómodas. Debajo de 768 vuelve a 1. */
    .ms-home-offer-grid,
    .ms-home-how-grid,
    .ms-home-solution-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* 2 columnas dejaban las tarjetas enormes en tablet; con 3 la seccion de
       destacados baja de ~1.950px a ~1.300px sin achicar la tarjeta. */
    .ms-home-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ms-home-section-head,
    .ms-home-cta-final .ms-home-container {
        align-items: flex-start;
        flex-direction: column;
    }

    .ms-home-cta-final__actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .ms-home-container {
        padding: 0 18px;
    }

    .ms-home-section {
        padding: 56px 0;
    }

    .ms-home-hero__inner {
        padding: 56px 18px 76px;
    }

    .ms-home-hero__title {
        font-size: clamp(2rem, 11vw, 3.25rem);
    }

    .ms-home-search__input {
        height: 56px;
        padding: 0 22px;
    }

    .ms-home-search__button {
        margin-top: 10px;
        position: static;
        width: 100%;
    }

    .ms-home-offers {
        margin-top: -28px;
    }

    .ms-home-offer-card {
        gap: 12px;
        padding: 12px;
    }

    .ms-home-offer-card img {
        flex-basis: 88px;
        height: 88px;
        width: 88px;
    }

    .ms-home-offer-grid,
    .ms-home-how-grid,
    .ms-home-solution-grid,
    .ms-home-benefit-grid {
        grid-template-columns: 1fr;
    }

    /* Los destacados en una columna daban 3.600px de scroll para 8 productos.
       Dos columnas es lo que espera cualquiera en un catalogo movil y deja la
       seccion en la mitad de alto. La tarjeta se compacta para acompañar. */
    .ms-home-product-grid,
    .ms-home-category-grid {
        gap: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ms-home-product-card {
        min-height: auto;
        padding: 10px;
    }

    .ms-home-product-card__image {
        height: 132px;
    }

    /* "Oportunidad unica !Cotiza!" se partia en dos lineas y tapaba media
       imagen en una tarjeta de ~176px. Se acota a una linea con elipsis. */
    .ms-home-product-card__badge {
        font-size: 9px;
        left: 14px;
        letter-spacing: 0.04em;
        max-width: calc(100% - 28px);
        overflow: hidden;
        padding: 3px 6px;
        text-overflow: ellipsis;
        top: 14px;
        white-space: nowrap;
    }

    .ms-home-product-card__brand {
        font-size: 10px;
        margin-top: 10px;
    }

    .ms-home-product-card__name {
        font-size: 13px;
        min-height: 35px;
    }

    .ms-home-product-card__price {
        font-size: 17px;
        margin-top: 8px;
    }

    /* "Agregar a cotizacion" no entra en una linea a este ancho: se deja
       envolver en dos en vez de desbordar la pildora. */
    .ms-home-product-card__cta {
        font-size: 10.5px;
        gap: 5px;
        letter-spacing: 0;
        line-height: 1.25;
        margin-top: 10px;
        padding: 9px 8px;
        text-align: center;
        white-space: normal;
    }

    .ms-home-cta-final__actions,
    .ms-home-cta-final__actions .ms-home-btn {
        width: 100%;
    }
}

/* Telefonos angostos: se mantienen las 2 columnas, solo se aprieta el aire.
   El texto del CTA se corta a una linea para que las tarjetas no se desalineen. */
@media (max-width: 400px) {
    .ms-home-container {
        padding: 0 14px;
    }

    .ms-home-product-grid,
    .ms-home-category-grid {
        gap: 10px;
    }

    .ms-home-product-card__image {
        height: 118px;
    }

    .ms-home-product-card__name {
        font-size: 12.5px;
    }

    .ms-home-product-card__price {
        font-size: 16px;
    }

    .ms-home-product-card__cta {
        font-size: 10px;
        padding: 8px 6px;
    }
}
