/*
 * Tech Guru, 11 October 2026: "All products and services" page (all-products.php, tg-all-products.tpl).
 * Matches the redesigned store pages (orderforms/themetags_cart/css/tg-products.css): same colours, card border,
 * radius, chips and section headings, with a compact card so every group fits on one page. No sidebar.
 */

.tg-allp {
    --allp-deep: var(--tg-blue-deep, #0d2b45);
    --allp-blue: var(--tg-blue-dark, #1487ba);
    --allp-line: var(--tg-line, #e5eaf1);
    --allp-muted: var(--tg-muted, #64748b);
    --allp-ink: var(--tg-ink, #1e293b);
    color: var(--allp-ink);
    margin-bottom: 24px;
}

.tg-allp-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Search panel ---------- */
.tg-allp-hero {
    margin: 0 0 8px;
    padding: 24px 24px 20px;
    background: #fff;
    border: 1px solid var(--allp-line);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(13, 43, 69, .06);
}
.tg-allp-hero__title {
    margin: 0;
    color: var(--allp-deep);
    font-family: inherit;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}
.tg-allp-hero__intro {
    margin: 6px 0 16px;
    color: var(--allp-muted);
    font-size: 15px;
    line-height: 1.5;
}
.tg-allp-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
}
.tg-allp-search {
    position: relative;
    flex: 1 1 420px;
    min-width: 0;
}
.tg-allp-search__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    color: var(--allp-muted);
    pointer-events: none;
}
.tg-allp .tg-allp-search__input {
    display: block;
    width: 100%;
    height: 52px;
    padding: 0 16px 0 46px;
    border: 1.5px solid #cfd9e5;
    border-radius: 12px;
    background: #fff;
    color: var(--allp-deep);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.3;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tg-allp .tg-allp-search__input::placeholder {
    color: #94a3b8;
    opacity: 1;
}
.tg-allp .tg-allp-search__input:focus {
    outline: none;
    border-color: var(--allp-blue);
    box-shadow: 0 0 0 3px rgba(20, 135, 186, .18);
}
.tg-allp .tg-allp-search__input::-webkit-search-cancel-button {
    cursor: pointer;
}
.tg-allp-count {
    flex: 0 0 auto;
    margin: 0;
    color: var(--allp-muted);
    font-size: 14px;
    font-weight: 600;
}

/* ---------- Category chips (same look as the brand chips on store pages) ---------- */
.tg-allp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0;
}
.tg-allp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    max-width: 100%;
    padding: 6px 14px;
    border: 1px solid var(--allp-line);
    border-radius: 999px;
    background: #fff;
    color: var(--allp-deep);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.tg-allp-chip:hover,
.tg-allp-chip:focus {
    border-color: rgba(20, 135, 186, .55);
    color: var(--allp-blue);
    text-decoration: none;
}
.tg-allp-chip:focus-visible {
    outline: 2px solid var(--allp-blue);
    outline-offset: 2px;
}
.tg-allp-chip__n {
    display: inline-block;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--allp-muted);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
.tg-allp-chip[aria-pressed="true"] {
    border-color: var(--allp-blue);
    background: var(--allp-blue);
    color: #fff;
}
.tg-allp-chip[aria-pressed="true"] .tg-allp-chip__n {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}
.tg-allp-chip--empty {
    order: 1;
    opacity: .5;
}

/* ---------- Nothing found ---------- */
.tg-allp-empty {
    margin: 24px 0 8px;
    padding: 28px 24px;
    background: #fff;
    border: 1px dashed #cfd9e5;
    border-radius: 14px;
    text-align: center;
}
.tg-allp-empty[hidden] {
    display: none !important;
}
.tg-allp-empty__title {
    margin: 0 0 4px;
    color: var(--allp-deep);
    font-size: 18px;
    font-weight: 700;
}
.tg-allp-empty__text {
    margin: 0;
    font-size: 15px;
}
.tg-allp-empty__text a {
    color: var(--allp-blue);
    font-weight: 600;
}
.tg-allp-alert {
    margin-top: 16px;
}

/* ---------- Sections ---------- */
.tg-allp-sec {
    scroll-margin-top: 110px;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--allp-line);
}
.tg-allp-sec--first {
    border-top: 0;
    padding-top: 4px;
}
.tg-allp-sec[hidden],
.tg-allp-block[hidden],
.tg-allp-card[hidden],
.tg-allp-more[hidden] {
    display: none !important;
}
.tg-allp-sec__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
}
.tg-allp-sec__name {
    margin: 0;
    color: var(--allp-deep);
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}
.tg-allp-sec__count {
    color: var(--allp-muted);
    font-size: 14px;
    font-weight: 500;
}
.tg-allp-sec__link {
    margin-left: auto;
    color: var(--allp-blue);
    font-size: 14px;
    font-weight: 600;
}
.tg-allp-sec__intro {
    flex-basis: 100%;
    margin: 2px 0 0;
    color: var(--allp-muted);
    font-size: 14.5px;
    line-height: 1.5;
}
.tg-allp-block {
    margin-top: 16px;
}
.tg-allp-block__name {
    margin: 22px 0 0;
    color: var(--allp-deep);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}
.tg-allp-block:first-of-type .tg-allp-block__name {
    margin-top: 6px;
}

/* ---------- Compact grid and cards ---------- */
.tg-allp-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 12px;
    align-items: stretch;
}
@media (max-width: 1199px) {
    .tg-allp-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 991px) {
    .tg-allp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
}
@media (max-width: 575px) {
    .tg-allp-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }
}

.tg-allp-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px 18px 16px;
    background: #fff;
    border: 1px solid var(--allp-line);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(13, 43, 69, .06);
    overflow-wrap: anywhere;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.tg-allp-card:hover {
    border-color: #cfd9e5;
    box-shadow: 0 10px 28px -12px rgba(13, 43, 69, .2);
}
.tg-allp-card--tile {
    background: linear-gradient(180deg, #f6fbfe 0, #fff 64px);
}
.tg-allp-card__name {
    margin: 0 0 8px;
    color: var(--allp-deep);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}
.tg-allp-card__intro {
    margin: 0 0 10px;
    color: #475569;
    font-size: 14px;
    line-height: 1.5;
}
.tg-allp-card__price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 5px;
    margin: 0 0 10px;
    line-height: 1.3;
}
.tg-allp-card__from {
    color: var(--allp-muted);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.tg-allp-card__amount {
    color: var(--allp-deep);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.tg-allp-card__cycle,
.tg-allp-card__gst {
    color: var(--allp-muted);
    font-size: 13px;
    font-weight: 500;
}
.tg-allp-card__setup,
.tg-allp-card__note {
    align-self: flex-start;
    margin: -4px 0 10px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: var(--allp-muted);
    font-size: 12.5px;
}
.tg-allp-card__note {
    background: #e9f6e2;
    color: #3d7a1f;
    font-weight: 600;
}
.tg-allp-card__feats {
    list-style: none;
    margin: 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--allp-line);
}
.tg-allp-card__feats li {
    position: relative;
    margin: 0 0 6px;
    padding-left: 24px;
    color: var(--allp-ink);
    font-size: 13.5px;
    line-height: 1.45;
}
.tg-allp-card__feats li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e9f6e2 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23478a24' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.4l2.6 2.6L12 5.6'/%3E%3C/svg%3E") center / 11px 11px no-repeat;
}
.tg-allp-card__snip {
    margin: 6px 0 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: #fffbea;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}
.tg-allp-card__snip[hidden] {
    display: none !important;
}
.tg-allp-card__foot {
    margin-top: auto;
    padding-top: 14px;
}
.tg-allp .tg-allp-card__cta {
    display: block;
    width: 100%;
    padding: 9px 14px;
    font-size: 14.5px;
    line-height: 1.3;
    text-align: center;
}
.tg-allp mark {
    padding: 0 1px;
    border-radius: 3px;
    background: #ffe58a;
    color: inherit;
}

/* ---------- Show all ---------- */
.tg-allp-more {
    display: block;
    margin: 16px auto 0;
    padding: 9px 20px;
    border: 1px solid var(--allp-line);
    border-radius: 999px;
    background: #fff;
    color: var(--allp-blue);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
}
.tg-allp-more:hover {
    border-color: rgba(20, 135, 186, .55);
}
.tg-allp-more:focus-visible {
    outline: 2px solid var(--allp-blue);
    outline-offset: 2px;
}

/* ---------- Tablets and phones ---------- */
@media (max-width: 767px) {
    .tg-allp-sec__link {
        flex-basis: 100%;
        margin-left: 0;
        order: 3;
    }
}
@media (max-width: 575px) {
    /* Theme gutters add up to 30px a side on phones (container 15 + column 15); bring the content to 16px,
       as tg-products.css does on the store pages. */
    .tg-allp {
        margin-left: -14px;
        margin-right: -14px;
    }
    .tg-allp-hero {
        padding: 18px 16px 16px;
    }
    .tg-allp-hero__title {
        font-size: 20px;
    }
    .tg-allp-hero__intro {
        font-size: 14.5px;
        margin-bottom: 12px;
    }
    .tg-allp-search {
        flex-basis: 100%;
    }
    .tg-allp .tg-allp-search__input {
        height: 48px;
    }
    /* Chips scroll sideways on phones instead of taking several lines. */
    .tg-allp-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-left: -16px;
        margin-right: -16px;
        padding: 0 16px 4px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .tg-allp-chips::-webkit-scrollbar {
        display: none;
    }
    .tg-allp-chip {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 5px 12px;
        font-size: 13.5px;
    }
    .tg-allp-sec {
        margin-top: 22px;
        padding-top: 22px;
    }
    .tg-allp-sec__name {
        font-size: 19px;
    }
    .tg-allp-card {
        padding: 16px 16px 14px;
    }
}

/* ---------- 19 October 2026: cards in a row line up, touch targets of 44 px ----------
   Cards in a row share the row lines (CSS subgrid): names, prices, feature lists and Order now buttons line up
   across the row. Browsers without subgrid keep the flex card above (button pinned to the card foot). */
@supports (grid-template-rows: subgrid) {
    /* Space between card rows is a card margin, not a row gap (a row gap would also open up around the empty
       rows inside each card). */
    .tg-allp-grid {
        row-gap: 0;
    }
    .tg-allp-grid > .tg-allp-card {
        margin-bottom: 16px;
        display: grid;
        grid-row: span 7;
        grid-template-rows: subgrid;
        row-gap: 0;
        align-content: start;
    }
    .tg-allp-grid > .tg-allp-card > .tg-allp-card__name { grid-row: 1; }
    .tg-allp-grid > .tg-allp-card > .tg-allp-card__intro { grid-row: 2; }
    .tg-allp-grid > .tg-allp-card > .tg-allp-card__price { grid-row: 3; align-self: start; }
    .tg-allp-grid > .tg-allp-card > .tg-allp-card__setup,
    .tg-allp-grid > .tg-allp-card > .tg-allp-card__note { grid-row: 4; justify-self: start; align-self: start; }
    .tg-allp-grid > .tg-allp-card > .tg-allp-card__feats { grid-row: 5; }
    .tg-allp-grid > .tg-allp-card > .tg-allp-card__snip { grid-row: 6; }
    .tg-allp-grid > .tg-allp-card > .tg-allp-card__foot { grid-row: 7; align-self: end; margin-top: 0; }
}
@supports (grid-template-rows: subgrid) {
    @media (max-width: 991px) {
        .tg-allp-grid > .tg-allp-card { margin-bottom: 14px; }
    }
    @media (max-width: 575px) {
        .tg-allp-grid > .tg-allp-card { margin-bottom: 12px; }
    }
}
.tg-allp .tg-allp-card__cta,
.tg-allp-more,
.tg-allp-chip {
    min-height: 44px;
}
.tg-allp-sec__link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
.tg-allp-empty__text a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
@media (max-width: 575px) {
    .tg-allp-chip {
        min-height: 44px;
    }
}
