/* blocks_automations — Figma node 1438:12849.

   2/5 content column on the LEFT, 3/5 frosted-glass 3x3 grid of toggle-cards
   on the RIGHT. The grid sits behind a backdrop-blur, each card alternates
   between an "on" state (white bg, purple toggle right) and an "off" state
   (faint cyan tint, grey toggle left), per the Figma design. */

.blocks-automations {
    position: relative;
    display: grid;
    /* `minmax(0, 1fr)` not bare 1fr — bare 1fr lets the track grow past
       viewport on mobile because of children's intrinsic max-content. */
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    max-width: 1700px;
    margin: 0 auto;
    padding: 80px 24px;
    box-sizing: border-box;
}

/* Decorative cropper bleeding off the LEFT viewport edge. */
.ba__cropper {
    position: absolute;
    top: 75%;
    left: calc(50% - 50vw);
    width: 714px;
    height: auto;
    transform: translate(-55%, -50%);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}
@media (max-width: 1279px) {
    .ba__cropper { transform: translate(-70%, -50%); }
}
@media (max-width: 1023px) {
    .ba__cropper { width: 480px; transform: translate(-75%, -50%); }
}
@media (max-width: 767px) {
    .ba__cropper { display: none; }
}

@media (max-width: 1023px) {
    /* Mobile: stacked, content above grid. */
    .blocks-automations {
        grid-template-areas:
            "left"
            "grid";
    }
    .ba__col-left { grid-area: left; }
    .ba__grid     { grid-area: grid; }
}

@media (min-width: 1024px) {
    .blocks-automations {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 60px;
        padding: 120px 32px;
        align-items: start;
    }
    .ba__col-left {
        grid-column: 1 / span 2;
        position: relative;
        z-index: 2;
    }
    .ba__grid {
        grid-column: 3 / -1;
    }
}

/* ---- Right column: 3x3 modular dashboard grid -------------------- */

.ba__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    backdrop-filter: blur(7.5px);
    -webkit-backdrop-filter: blur(7.5px);
    align-items: stretch;
}
@media (min-width: 1280px) {
    .ba__grid { gap: 20px; }
}
@media (max-width: 767px) {
    /* Tight squeeze on phones — drop to two columns, then the cards
       wrap naturally. */
    .ba__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .ba__grid { grid-template-columns: 1fr; }
}

.ba__card {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid;
    /* Plain box-shadow rather than filter:drop-shadow because the latter
       creates a stacking context that breaks backdrop-filter on the same
       element — and the cards rely on backdrop-filter to read as white
       over the section's coloured gradient. */
    box-shadow: 0 0 0.985px rgba(0, 0, 0, 0.15);
    /* Card is a <button>: reset native styles + make text left-aligned. */
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: background-color 200ms ease, border-color 200ms ease;
}
.ba__card:focus-visible {
    outline: 2px solid #5e4c92;
    outline-offset: 2px;
}
/* Theme's global `button:hover` sets a beige border on every <button>;
   override it so the card's --on/--off border-color rules stay in effect. */
.ba__card:hover,
.ba__card--on:hover  { border-color: rgba(244, 246, 248, 0); }
.ba__card--off:hover { border-color: #afebff; }
@media (min-width: 1280px) {
    .ba__card {
        padding: 22px;
        border-radius: 22px;
    }
}
.ba__card--on,
.ba__card--off {
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.ba__card--on {
    background-color: rgba(255, 255, 255, 0.7);
    border-color: rgba(244, 246, 248, 0);
}
.ba__card--off {
    background-color: rgba(175, 235, 255, 0.05);
    border-color: #afebff;
}

.ba__card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

.ba__icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
@media (min-width: 1280px) {
    .ba__icon { width: 48px; height: 48px; border-radius: 8px; }
}
.ba__icon img,
.ba__icon svg {
    display: block;
    width: 60%;
    height: 60%;
    object-fit: contain;
}
/* Bleed variant: icon image fills the entire 48px square, ignoring the
   inner 60% inset. Used by the Shopify Flow + Klaviyo PNGs which already
   bake their own coloured square into the asset. */
.ba__icon--bleed img,
.ba__icon--bleed svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Toggle pill — 44x24 with a 20px circle. ON state: purple bg, knob right.
   OFF state: light grey bg w/ border, knob left. */
.ba__toggle {
    flex: 0 0 auto;
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 9999px;
    box-sizing: border-box;
    transition: background-color 200ms ease, border-color 200ms ease;
}
.ba__toggle-knob {
    transition: left 200ms cubic-bezier(0.4, 0.0, 0.2, 1), border-color 200ms ease;
}
.ba__card--on .ba__toggle {
    background: #29165e;
}
.ba__card--off .ba__toggle {
    background: #f1f2f3;
    border: 1px solid #e0e0e5;
}
.ba__toggle-knob {
    position: absolute;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 9999px;
    background: #fff;
    box-sizing: border-box;
}
.ba__card--on .ba__toggle-knob {
    left: 22px;
    border: 1px solid #fff;
}
.ba__card--off .ba__toggle-knob {
    left: 1px;
    border: 1px solid #e0e0e5;
}

.ba__card-title {
    margin: 8px 0 0 0;
    font-family: 'Inter', 'SF Pro Display', sans-serif;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    color: #130041;
}
@media (min-width: 1280px) {
    .ba__card-title {
        margin-top: 12px;
        font-size: 15px;
        line-height: 1.35;
    }
}

.ba__card-desc {
    margin: 0;
    font-family: 'Inter', 'SF Pro Display', sans-serif;
    font-weight: 400;
    font-size: 11px;
    line-height: 1.45;
    color: #484550;
}
@media (min-width: 1280px) {
    .ba__card-desc {
        font-size: 12.5px;
        line-height: 1.5;
    }
}
