/* ==========================================================================
   PickAndPackBD — WooCommerce Product Cards
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════════
   RESET WC DEFAULT FLOATS & WIDTHS ON THE LOOP
   ══════════════════════════════════════════════════════════════════ */
.woocommerce ul.products::before,
.woocommerce ul.products::after,
.woocommerce-page ul.products::before,
.woocommerce-page ul.products::after {
    display: none !important;
}

.woocommerce ul.products,
.woocommerce-page ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 15px !important;
    list-style: none !important;
    margin: 0 0 40px !important;
    padding: 0 !important;
    float: none !important;
    clear: both;
}

/* ══════════════════════════════════════════════════════════════════
   CARD SHELL
   ══════════════════════════════════════════════════════════════════ */
li.gt-product-card {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    background: var(--bg-body) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    width: auto !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: box-shadow 0.28s ease, transform 0.28s ease, border-color 0.28s ease;
}

li.gt-product-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.11);
    transform: translateY(-3px);
    border-color: var(--border-dark);
}

/* ══════════════════════════════════════════════════════════════════
   IMAGE AREA
   ══════════════════════════════════════════════════════════════════ */
.gt-card-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: var(--bg-section);
    flex-shrink: 0;
}

.gt-card-img-link {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
}

.gt-card-media .gt-card-img,
.gt-card-media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.5s ease;
}

li.gt-product-card:hover .gt-card-media img {
    transform: scale(1.06);
}

/* ── Badge ───────────────────────────────────────────────────────── */
.gt-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1;
    pointer-events: none;
}

.gt-badge--sale { background: #ef4444; color: #fff; }
.gt-badge--new  { background: var(--brand); color: #fff; }
.gt-badge--hot  { background: #f97316; color: #fff; }

/* ── Add-to-cart tray ────────────────────────────────────────────── */
.gt-card-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 10px 12px;
    display: flex;
    gap: 6px;
    z-index: 3;
    transform: translateY(110%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

li.gt-product-card:hover .gt-card-actions {
    transform: translateY(0);
}

/* shared button base */
.gt-atc-btn,
.gt-buy-btn,
.gt-view-btn {
    flex: 1 1 0;
    min-width: 0; /* allow flex items to shrink below content width instead of overflowing */
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 40px;
    padding: 0 10px;
    border: none !important;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s ease, opacity 0.2s ease, transform 0.15s ease !important;
    line-height: 1;
}

.gt-atc-btn svg,
.gt-buy-btn svg {
    flex-shrink: 0;
    fill: currentColor;
}

.gt-atc-btn span,
.gt-buy-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Add to Cart — outlined green */
.gt-atc-btn {
    background: rgba(0,164,134,0.12) !important;
    color: var(--brand) !important;
    border: 1.5px solid var(--brand) !important;
}

.gt-atc-btn:hover {
    background: var(--brand) !important;
    color: #fff !important;
}

.gt-atc-btn:hover svg { fill: #fff; }

/* Buy Now — solid green */
.gt-buy-btn {
    background: var(--brand) !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(0,164,134,0.35);
}

.gt-buy-btn:hover {
    background: var(--brand-hover) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* View Product (for variable/out-of-stock) */
.gt-card-actions--single .gt-view-btn {
    background: var(--brand) !important;
    color: #fff !important;
}

/* Loading state */
.gt-atc-btn.gt-loading,
.gt-buy-btn.gt-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* In Cart state */
.gt-atc-btn.gt-in-cart {
    background: var(--bg-brand) !important;
    color: var(--brand) !important;
    border: 1.5px solid var(--brand) !important;
    pointer-events: none;
    cursor: default;
}

/* Suppress WC's injected view-cart link */
.gt-card-actions .added_to_cart {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════════
   CARD BODY
   ══════════════════════════════════════════════════════════════════ */
.gt-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 14px 16px;
    flex: 1;
}

.gt-card-cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--brand);
    line-height: 1;
}

.gt-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
    text-decoration: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.gt-card-title:hover {
    color: var(--brand);
}

/* Stars */
.gt-card-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.gt-star {
    width: 13px;
    height: 13px;
    fill: #d1d5db;
    flex-shrink: 0;
}

.gt-star--on { fill: #f59e0b; }

.gt-card-rating-count {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-left: 3px;
}

/* Price */
.gt-card-price {
    margin-top: auto;
    padding-top: 6px;
}

.gt-card-price .price {
    display: flex !important;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1;
}

.gt-card-price .woocommerce-Price-amount {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}

.gt-card-price del {
    opacity: 0.6;
}

.gt-card-price del .woocommerce-Price-amount {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

.gt-card-price ins {
    text-decoration: none;
}

.gt-card-price ins .woocommerce-Price-amount {
    color: #ef4444;
}

/* ══════════════════════════════════════════════════════════════════
   SUPPRESS DEFAULT WC OUTPUT rendered outside our markup
   (WC hooks still fire sale flash / title / price via do_action —
    we never call those hooks in our template so nothing extra
    renders, but keep these as a safety net)
   ══════════════════════════════════════════════════════════════════ */
li.gt-product-card > a.woocommerce-LoopProduct-link,
li.gt-product-card > .onsale,
li.gt-product-card > h2.woocommerce-loop-product__title,
li.gt-product-card > .star-rating,
li.gt-product-card > .price {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 1080px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 640px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .gt-card-body {
        padding: 10px 10px 12px;
        gap: 4px;
    }

    .gt-card-title { font-size: 13px; }

    .gt-card-price .woocommerce-Price-amount { font-size: 13.5px; }

    /* Always show action tray on touch devices */
    .gt-card-actions {
        transform: translateY(0) !important;
        background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 100%);
        padding-bottom: 10px;
    }

    .gt-atc-btn,
    .gt-buy-btn,
    .gt-view-btn {
        height: 36px;
        font-size: 11px;
        padding: 0 6px;
        gap: 4px;
    }
}

/* Narrow phone cards (2-col grid at this width): side-by-side icon+label
   buttons no longer fit comfortably, so stack them full-width instead of
   letting them get squeezed or clipped. */
@media (max-width: 480px) {
    .gt-card-actions {
        flex-direction: column;
        gap: 5px;
        padding: 0 8px 8px;
    }

    .gt-atc-btn,
    .gt-buy-btn,
    .gt-view-btn {
        width: 100%;
        height: 32px;
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: 1fr !important;
    }

    /* Single-column cards are wide again, so go back to side-by-side buttons */
    .gt-card-actions {
        flex-direction: row;
    }

    .gt-atc-btn,
    .gt-buy-btn,
    .gt-view-btn {
        height: 38px;
        font-size: 12px;
    }
}

/* Single product "Delivery Options" styles now live in
   assets/css/delivery-options.css (enqueued only on product pages). */
