/* ================================================================== */
/* HOME PROMOTION GRID                                                 */
/* Markup: resources/views/components/home-promo-grid.blade.php        */
/* Loads after css/promo-carousel.css: the carousel becomes the grid's  */
/* large tile, so a few of its rules are re-set here.                  */
/* ================================================================== */

.promo-grid {
    --promo-grid-gap: 12px;
    --promo-tile-h: 108px; /* each of the two stacked tiles on phones */

    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas:
        "main tile1"
        "main tile2"
        "strip strip";
    grid-template-rows: 1fr 1fr auto; /* the two stacked tiles always share the height equally */
    gap: var(--promo-grid-gap);
    max-width: 1920px;
    margin: 0 auto;
    padding: 12px 16px 4px;
    font-family: 'Inter', sans-serif;
}
.promo-grid__main { grid-area: main; min-width: 0; }
.promo-grid > .promo-tile:nth-of-type(1) { grid-area: tile1; }
.promo-grid > .promo-tile:nth-of-type(2) { grid-area: tile2; }
.promo-strip { grid-area: strip; }

/* Missing parts close up. */
.promo-grid--one-tile {
    grid-template-areas:
        "main tile1"
        "strip strip";
    grid-template-rows: auto auto;
}
.promo-grid--no-tiles {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "strip";
    grid-template-rows: auto auto;
}
.promo-grid--no-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "tile1 tile2" "strip strip";
    grid-template-rows: auto auto;
}
.promo-grid--no-main.promo-grid--one-tile { grid-template-areas: "tile1 tile1" "strip strip"; }

/* ── The carousel as the large tile ── */
.promo-grid .promo-carousel {
    position: relative;
    height: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}
.promo-grid .promo-carousel__frame,
.promo-grid .promo-carousel__viewport,
.promo-grid .promo-carousel__track { height: 100%; }
.promo-grid .promo-carousel.has-peek .promo-slide { flex-basis: 100%; }
/* Dots and pause sit on the picture, in a pill, below the slide's button. */
.promo-grid .promo-carousel__controls {
    position: absolute;
    bottom: 8px;
    left: 50%;
    z-index: 6;
    min-height: 24px;
    padding: 0 6px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.15);
    transform: translateX(-50%);
}
.promo-grid .promo-slide__content { padding-bottom: 40px; }

@media (max-width: 767.98px) {
    /* As tall as the two tiles beside it. */
    .promo-grid:not(.promo-grid--no-tiles) .promo-carousel {
        --promo-height: calc(2 * var(--promo-tile-h) + var(--promo-grid-gap));
        --promo-pad-x: 12px;
    }
    .promo-grid .promo-slide__title { font-size: 17px; }
    .promo-grid .promo-slide__badge { font-size: 9px; }
    .promo-grid .promo-slide__btn {
        max-width: 100%;
        padding: 0 10px;
        font-size: 12px;
        white-space: normal;
        text-align: center;
    }
}

/* ── Category tiles ── */
.promo-tile {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: var(--promo-tile-h);
    overflow: hidden;
    border-radius: 12px;
    color: #111827 !important;
    text-decoration: none !important;
    isolation: isolate;
    transition: box-shadow 0.2s ease;
}
.promo-tile--warm { background: linear-gradient(135deg, #fff5f0 0%, #ffe6dc 100%); }
.promo-tile--cool { background: linear-gradient(135deg, #f3f5f9 0%, #e2e8f0 100%); }
.promo-tile--light { background-color: #f3f4f6; }
.promo-tile:hover { box-shadow: 0 4px 14px rgba(17, 24, 39, 0.12); }
.promo-tile:focus-visible {
    outline: 3px solid var(--mm-color-primary, #b20015);
    outline-offset: 2px;
}

.promo-tile__text {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    max-width: 74%;
    padding: 10px 0 10px 12px;
}
.promo-tile__title {
    color: #111827;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.1;
    text-transform: uppercase;
}
.promo-tile__highlight {
    display: block;
    color: var(--mm-color-primary, #b20015);
}
.promo-tile__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #4b5563;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}
.promo-tile__btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    margin-top: 2px;
    padding: 0 8px;
    border-radius: 6px;
    background-color: #D92228;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}
.promo-tile:hover .promo-tile__btn { background-color: #b20015; }

/* Picture on the right, fading out under the words. */
.promo-tile__media {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    width: 58%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 45%);
    mask-image: linear-gradient(90deg, transparent 0, #000 45%);
}
.promo-tile__img {
    display: block;
    width: 100%;
    height: 100%;
}
.promo-tile__media--cover .promo-tile__img { object-fit: cover; object-position: center; }
.promo-tile__media--contain .promo-tile__img { padding: 6px; object-fit: contain; object-position: right center; }

/* No picture: a large faint icon in the corner. */
.promo-tile__icon {
    position: absolute;
    right: -8px;
    bottom: -8px;
    z-index: 1;
    width: 72px;
    height: 72px;
    color: var(--mm-color-primary, #b20015);
    opacity: 0.14;
}
.promo-tile--cool .promo-tile__icon { color: #1e3a8a; }

/* ── Strip: two small tiles under the grid ── */
.promo-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--promo-grid-gap);
}
.promo-strip__item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 60px;
    padding: 8px;
    border-radius: 12px;
    color: #111827 !important;
    text-decoration: none !important;
    transition: box-shadow 0.2s ease;
}
.promo-strip__item--red { background-color: #fdeff0; }
.promo-strip__item--navy { background-color: #eaf1fb; }
.promo-strip__item:hover { box-shadow: 0 4px 14px rgba(17, 24, 39, 0.1); }
.promo-strip__item:focus-visible {
    outline: 3px solid var(--mm-color-primary, #b20015);
    outline-offset: 2px;
}
.promo-strip__icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ffffff;
}
.promo-strip__item--red .promo-strip__icon { background-color: #D92228; }
.promo-strip__item--navy .promo-strip__icon { background-color: #1e3a8a; }
.promo-strip__icon svg { width: 18px; height: 18px; }
.promo-strip__text {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.promo-strip__title {
    color: #111827;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}
.promo-strip__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: #4b5563;
    font-size: 11px;
    line-height: 1.3;
}
.promo-strip__chev {
    display: none; /* no room beside the words on phones */
    flex: none;
    width: 18px;
    height: 18px;
    color: #6b7280;
}

/* The narrowest phones drop the arrows and give the tile words the full width
   (the corner icon is faint enough to sit behind them). */
@media (max-width: 359.98px) {
    .promo-tile__btn svg,
    .promo-grid .promo-slide__btn svg { display: none; }
    .promo-tile__text { max-width: 90%; }
    .promo-tile__title { font-size: 12.5px; }
}

@media (min-width: 768px) {
    .promo-grid {
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
        padding: 16px 24px 4px;
        --promo-grid-gap: 16px;
    }
    .promo-tile { min-height: 0; }
    .promo-tile__text { gap: 6px; max-width: 62%; padding: 16px 0 16px 20px; }
    .promo-tile__title { font-size: 20px; }
    .promo-tile__desc { font-size: 13px; }
    .promo-tile__btn { height: 34px; margin-top: 4px; padding: 0 14px; font-size: 13px; }
    .promo-tile__media { width: 55%; }
    .promo-tile__icon { right: 8px; bottom: -12px; width: 120px; height: 120px; }
    .promo-strip__item { gap: 12px; min-height: 72px; padding: 12px 16px; }
    .promo-strip__icon { width: 44px; height: 44px; }
    .promo-strip__icon svg { width: 22px; height: 22px; }
    .promo-strip__title { font-size: 16px; }
    .promo-strip__desc { font-size: 13px; }
    .promo-strip__chev { display: block; }

    /* The large tile is narrower than the old full-width banner, so its words
       reach further across the picture: keep the shade stronger there. */
    .promo-grid .promo-slide__scrim {
        background: linear-gradient(90deg, rgba(17, 24, 39, 0.94) 0%, rgba(17, 24, 39, 0.86) 55%, rgba(17, 24, 39, 0.4) 100%);
    }
    .promo-grid .promo-slide--light .promo-slide__scrim {
        background: linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.9) 60%, rgba(255, 255, 255, 0.45) 100%);
    }
}

@media (min-width: 1024px) {
    .promo-grid { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); }
    .promo-tile__title { font-size: clamp(20px, 1.6vw, 26px); }
}

@media (prefers-reduced-motion: reduce) {
    .promo-tile,
    .promo-tile__btn,
    .promo-strip__item { transition: none; }
}
