/* ==========================================================
   HORIZON BEE AFRICA — SHOP CARDS (Apiken style)

   Loaded after shop.css and cart.css on the shop and product
   pages; only changes how the product cards look and move.

   Computer: 5 cards a row. Hover a card: the photo zooms a
   little, "Add to cart" slides up from the bottom of the
   photo, quick view and share slide in at the top right.
   Phones (no hover): 2 a row, a round cart button and the two
   buttons are always shown, smaller.
   Quick view and share: js/shop-cards.js
   ========================================================== */

.product-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
}

/* "You may also need" on a product page stays 4 a row */
.product-grid.product-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.product-card {
    position: relative;

    overflow: hidden;

    background: var(--white, #ffffff);
    border: 1px solid #e7e2d6;
    border-radius: 12px;

    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.product-card:hover {
    border-color: #e1cf9c;
    box-shadow: 0 12px 28px rgba(43, 29, 0, 0.1);
}


/* ---------- Photo ---------- */

.product-card-media {
    position: relative;

    overflow: hidden;

    background: linear-gradient(180deg, #ffffff 45%, #fff3d6 100%);
}

.product-card .product-card-image {
    padding: 0;

    background: transparent;
    border-bottom: 0;
}

.product-card-media .product-card-image img {
    transition: transform 0.45s ease;
}

.product-card:hover .product-card-media .product-card-image img {
    transform: scale(1.05);
}

.product-card .product-badges {
    top: 10px;
    left: 10px;
    z-index: 2;
}

.product-card .product-badge {
    border-radius: 999px;
    padding: 3px 9px;
}


/* Branded photos (logo at the top left, "ORDER NOW" and the phone at
   the bottom): the badges go under the logo */
.product-card-media.is-branded .product-badges {
    top: 15%;
}

/* ---------- Quick view / share (top right) ---------- */

.card-icons {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;

    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    padding: 0;

    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #ece6d8;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(43, 29, 0, 0.12);

    color: var(--brown, #412e03);

    font-size: 15px;

    cursor: pointer;

    opacity: 0;
    transform: translateX(16px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.card-icon:nth-child(2) {
    transition-delay: 0.05s;
}

.product-card:hover .card-icon,
.product-card:focus-within .card-icon {
    opacity: 1;
    transform: none;
}

.card-icon:hover,
.card-icon:focus-visible {
    background: var(--brown, #412e03);
    border-color: var(--brown, #412e03);

    color: #ffffff;
}


/* ---------- Add to cart: slides up over the bottom of the photo ---------- */

.product-card-media .buy-box {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;

    display: flex;

    margin: 0;
    padding: 0;

    transform: translateY(101%);
    transition: transform 0.3s ease;
}

.product-card:hover .product-card-media .buy-box,
.product-card:focus-within .product-card-media .buy-box {
    transform: none;
}

/* Quantity: 1 from the card (choose more in quick view or on the product page) */
.product-card-media .buy-box .qty {
    display: none;
}

.product-card-media .buy-add {
    flex: 1;
    justify-content: center;
    gap: 8px;

    min-height: 46px;

    background: var(--brown, #412e03);
    border: 0;
    border-radius: 0;

    color: #ffffff;

    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.product-card-media .buy-add:hover,
.product-card-media .buy-add:focus-visible {
    background: var(--gold, #d89b00);

    color: #2b1d00;
}

.product-card-media .buy-add.is-added {
    background: #1d6b3a;

    color: #ffffff;
}

.product-card-media .buy-out {
    min-height: 40px;

    background: rgba(244, 241, 234, 0.96);
    border-radius: 0;
}


/* ---------- Name and price ---------- */

.product-card .product-card-body {
    align-items: center;
    gap: 4px;

    padding: 12px 12px 14px;

    text-align: center;
}

.product-card .product-card-name {
    min-height: 2.7em;

    font-size: 15px;
    font-weight: 600;
}

.product-card:hover .product-card-name {
    color: var(--brown, #412e03);
}

.product-card .product-card-price {
    justify-content: center;
    gap: 8px;

    margin-top: auto;
}

.product-card .product-card-price s {
    color: #a39d90;

    font-size: 14px;
}

.product-card .product-card-price strong {
    color: #c88a00;

    font-size: 17px;
}

.product-card .stock {
    justify-content: center;

    font-size: 12px;
}


/* ---------- Related products (product page): same look ---------- */

a.product-card .product-card-image {
    background: linear-gradient(180deg, #ffffff 45%, #fff3d6 100%);
}

a.product-card:hover .product-card-image img {
    transform: scale(1.05);
}

a.product-card .product-card-image img {
    transition: transform 0.45s ease;
}


/* ---------- Share menu (opened by the share button) ---------- */

.card-share-menu {
    position: fixed;
    z-index: 1200;

    display: grid;
    gap: 2px;

    min-width: 190px;
    padding: 6px;

    background: #ffffff;
    border: 1px solid #ece6d8;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(31, 28, 22, 0.18);
}

.card-share-menu[hidden] {
    display: none;
}

.card-share-menu a,
.card-share-menu button {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 9px 12px;

    background: none;
    border: 0;
    border-radius: 8px;

    color: var(--text, #1f1c16);

    font: inherit;
    font-size: 14px;
    text-align: left;
    text-decoration: none;

    cursor: pointer;
}

.card-share-menu a:hover,
.card-share-menu button:hover,
.card-share-menu a:focus-visible,
.card-share-menu button:focus-visible {
    background: #f7f3ea;
}

.card-share-menu i {
    width: 18px;

    color: var(--brown, #412e03);

    text-align: center;
}


/* ---------- Quick view ---------- */

.quick-view {
    width: min(920px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;

    overflow: auto;

    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.quick-view::backdrop {
    background: rgba(20, 16, 8, 0.55);
}

.quick-view-inner {
    position: relative;

    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 26px;

    padding: 24px;
}

.quick-view-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;

    width: 38px;
    height: 38px;

    background: #f4f1ea;
    border: 0;
    border-radius: 50%;

    color: var(--text, #1f1c16);

    font-size: 18px;

    cursor: pointer;
}

.quick-view-photo {
    display: flex;
    align-items: center;
    justify-content: center;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: linear-gradient(180deg, #ffffff 45%, #fff3d6 100%);
    border: 1px solid #ece6d8;
    border-radius: 12px;
}

.quick-view-photo img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

.quick-view-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    margin: 10px 0 0;
    padding: 0;

    list-style: none;
}

.quick-view-thumbs button {
    width: 58px;
    height: 58px;
    padding: 2px;

    background: #ffffff;
    border: 2px solid #ece6d8;
    border-radius: 8px;

    cursor: pointer;
}

.quick-view-thumbs button.is-active {
    border-color: var(--gold, #d89b00);
}

.quick-view-thumbs img {
    width: 100%;
    height: 100%;

    object-fit: contain;
}

.quick-view-info {
    display: flex;
    flex-direction: column;
    gap: 10px;

    min-width: 0;
    padding-top: 8px;
}

.quick-view-category {
    color: var(--gold, #d89b00);

    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.quick-view-info h2 {
    margin: 0;

    font-size: clamp(20px, 3vw, 26px);
    line-height: 1.25;
}

.quick-view-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}

.quick-view-price strong {
    color: #c88a00;

    font-size: 24px;
}

.quick-view-price s {
    color: #a39d90;
}

.quick-view-summary {
    margin: 0;

    color: var(--text-muted, #5c574d);

    font-size: 14.5px;
    line-height: 1.6;
}

.quick-view-buy {
    display: flex;
    gap: 10px;

    margin-top: 6px;
}

.quick-view-buy .qty {
    flex: 0 0 auto;
}

.quick-view-buy .buy-add {
    flex: 1;
}

.quick-view-done {
    margin: 0;

    color: #1d6b3a;

    font-size: 14px;
    font-weight: 600;
}

.quick-view-done a,
.quick-view-done button {
    padding: 0;

    background: none;
    border: 0;

    color: var(--brown, #412e03);

    font: inherit;
    text-decoration: underline;

    cursor: pointer;
}

.quick-view-more {
    margin-top: 4px;

    color: var(--brown, #412e03);

    font-weight: 700;
}


/* ---------- Sizes ---------- */

@media (max-width: 1180px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .product-grid,
    .product-grid.product-grid-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .product-grid,
    .product-grid.product-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-card {
        border-radius: 10px;
    }

    .product-card .product-card-body {
        padding: 9px 8px 11px;
    }

    .product-card .product-card-name {
        font-size: 13.5px;
    }

    .product-card .product-card-price strong {
        font-size: 15px;
    }

    .product-card .product-card-price s {
        font-size: 12px;
    }

    .quick-view-inner {
        grid-template-columns: 1fr;
        gap: 14px;

        padding: 16px;
    }
}

/* Phones and tablets without a mouse: nothing to hover, so the
   buttons are always there (smaller), and a round cart button
   sits at the bottom right of the photo */
@media (hover: none), (pointer: coarse) {

    .card-icon {
        width: 34px;
        height: 34px;

        font-size: 13px;

        opacity: 1;
        transform: none;
    }

    .card-icons {
        top: 8px;
        right: 8px;
        gap: 6px;
    }

    .product-card-media .buy-box {
        left: auto;
        right: 8px;
        bottom: 8px;

        transform: none;
    }

    .product-card-media .buy-add {
        width: 40px;
        min-height: 40px;
        padding: 0;

        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(43, 29, 0, 0.25);
    }

    .product-card-media .buy-add .buy-add-text,
    .product-card-media .buy-add.is-added .buy-add-done {
        display: none;
    }

    .product-card-media .buy-out {
        padding: 0 10px;

        border-radius: 999px;

        font-size: 11.5px;
    }

    .product-card:hover .product-card-media .product-card-image img {
        transform: none;
    }

    /* Branded photo: the cart button sits above "ORDER NOW" / the phone */
    .product-card-media.is-branded .buy-box {
        bottom: 20%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card-icon,
    .product-card-media .buy-box,
    .product-card-media .product-card-image img {
        transition: none;
    }
}


/* ==========================================================
   CATEGORIES MENU: GROUPS ("Products")
   A group's pane lists its categories, each with its products.
   ========================================================== */

.cat-subs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 22px 28px;
}

.cat-sub {
    min-width: 0;
}

.cat-sub-head {
    display: flex;
    align-items: center;
    gap: 8px;

    padding-bottom: 8px;
    margin-bottom: 4px;

    border-bottom: 2px solid var(--gold, #d89b00);

    color: var(--brown, #412e03);

    font-size: 15px;
    font-weight: 700;
    text-decoration: none;

    transition: color 0.15s ease;
}

.cat-sub-head:hover,
.cat-sub-head:focus-visible,
.cat-sub-head.is-active {
    color: var(--gold, #d89b00);
}

.cat-sub-products {
    margin: 0;
    padding: 0;

    list-style: none;
}

.cat-sub-products a {
    display: block;

    padding: 7px 0;

    border-bottom: 1px solid var(--line, #ececec);

    color: var(--text, #1f1c16);

    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;

    transition: color 0.15s ease, padding-left 0.15s ease;
}

.cat-sub-products a:hover,
.cat-sub-products a:focus-visible {
    padding-left: 4px;
    color: var(--gold, #d89b00);
}

.cat-soon {
    display: inline-block;

    margin: 8px 0 0;
    padding: 3px 10px;

    background: #fbf3dc;
    border-radius: 999px;

    color: #8a6200;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.cat-sub.is-empty .cat-sub-head {
    border-bottom-color: var(--line, #ececec);
}

/* Phones: the group opens into its categories, one under the other */
@media (max-width: 768px) {

    .cat-subs {
        grid-template-columns: 1fr;
        gap: 14px;

        padding-left: 12px;

        border-left: 2px solid var(--line, #ececec);
    }

    .cat-sub-head {
        padding: 6px 0;
        margin: 0;

        border-bottom: 0;
    }

    .cat-sub-products a {
        padding: 9px 0 9px 10px;

        border-bottom: 0;

        font-size: 15px;
    }

    .cat-soon {
        margin: 2px 0 0 10px;
    }
}
