/* Tobor Accessory Cards Widget — base defaults match Figma node 1768:24787 exactly. */

.tobor-acards {
    background-color: #ffffff;
    padding: 64px 96px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.tobor-acards__header {
    display: flex;
    gap: 32px;
    align-items: center;
    width: 100%;
}

.tobor-acards__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 40px;
    color: #171717;
}

.tobor-acards__viewall {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: #506ccd;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.tobor-acards__viewall:focus-visible {
    outline: 2px solid #506ccd;
    outline-offset: 2px;
    border-radius: 4px;
}

.tobor-acards__viewall:hover {
    color: #506ccd;
}

.tobor-acards__viewall img {
    width: 16px;
    height: 16px;
    display: block;
    transition: transform 0.2s ease;
}

/* Toggle chevron: point down when collapsed, up when expanded. Scoped to the
   button-role control (it carries aria-expanded) so a real link's arrow is
   left pointing right. */
.tobor-acards__viewall[aria-expanded="false"] img {
    transform: rotate(90deg);
}

.tobor-acards__viewall[aria-expanded="true"] img {
    transform: rotate(-90deg);
}

/* Collapsed: show only the first two rows (8 cards); the rest reveal on "View all". */
.tobor-acards.is-collapsed .tobor-acards__grid .tobor-acards__card:nth-child(n + 9) {
    display: none;
}

.tobor-acards__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

.tobor-acards__card {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px;
    background-color: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    text-decoration: none;
    transition: filter 0.2s ease;
}

.tobor-acards__card:hover {
    filter: drop-shadow(0px 6px 6px rgba(24, 39, 75, 0.12)) drop-shadow(0px 8px 12px rgba(24, 39, 75, 0.08));
}

.tobor-acards__card-img {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    background-color: #f8fafc;
    overflow: hidden;
}

.tobor-acards__card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.tobor-acards__card-info {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tobor-acards__card-name {
    flex: 1;
    min-height: 0;
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: #525252;
}

.tobor-acards__card-price {
    margin: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: #506ccd;
}

.tobor-acards__card-price .woocommerce-Price-amount {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
}

.tobor-acards__add {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: #99c300;
    border-radius: 128px;
    border: 0;
    cursor: pointer;
    z-index: 1;
    transition: background-color 0.2s ease, transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}

.tobor-acards__add:hover {
    background-color: #86ab00;
}

.tobor-acards__add:active {
    transform: scale(0.94);
}

.tobor-acards__add:focus-visible {
    outline: 2px solid #506ccd;
    outline-offset: 2px;
}

.tobor-acards__add.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.tobor-acards__add.is-added {
    background-color: #86ab00;
}

.tobor-acards__add img {
    width: 24px;
    height: 24px;
    display: block;
}

.tobor-acards__add--cart {
    display: flex;
    width: auto;
    min-width: 119px;
    height: 34px;
    padding: 6px 14px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 24px;
    color: #171717;
    white-space: nowrap;
}

.tobor-acards__card:hover .tobor-acards__add,
.tobor-acards__add:focus-visible {
    display: flex;
}

/* Touch devices have no hover, so the reveal above never fired and the
   quick-add was unreachable on phones (task 139). The card itself is a link,
   so a tap-to-reveal would eat the tap that should open the product — show
   the button outright instead wherever hover does not exist. */
@media (hover: none) {
    .tobor-acards__add {
        display: flex;
    }
}

@media (max-width: 1200px) {
    .tobor-acards__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Tablet — Figma 1519:15435 (768px): 2×2 grid. */
@media (max-width: 1024px) {
    .tobor-acards {
        padding: 64px 32px;
    }

    .tobor-acards__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile — Figma 1757:23212 (390px): single column list. */
@media (max-width: 767px) {
    .tobor-acards {
        padding: 32px 16px;
    }

    .tobor-acards__title {
        font-size: 28px;
        line-height: 32px;
    }

    .tobor-acards__grid {
        grid-template-columns: 1fr;
    }
}

/* Wide screens: content capped at design width. */
.tobor-acards__header,
.tobor-acards__grid {
    width: 100%;
    max-width: 1248px;
    margin-left: auto;
    margin-right: auto;
}
