/* ============================================================
   Alvar Fresh – Top Picks Section
   Live WooCommerce product grid
   ============================================================ */

/* ── Section wrapper ────────────────────────────────────────── */
.atp-section {
    padding: 56px 20px 64px;
    background: #fff;
    font-family: 'DM Sans', 'Segoe UI', Arial, sans-serif;
}

/* ── Header row ─────────────────────────────────────────────── */
.atp-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    max-width: 1120px;
    margin: 0 auto 32px;
    flex-wrap: wrap;
}

.atp-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.atp-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #3d7a1a;
}

.atp-title {
    font-size: clamp(22px, 3.5vw, 32px);
    font-weight: 700;
    color: #0d1f06;
    margin: 0;
    line-height: 1.2;
}

.atp-view-all-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2d5a12;
    text-decoration: none;
    border-bottom: 1.5px solid #2d5a12;
    padding-bottom: 1px;
    transition: color 0.18s, border-color 0.18s;
}
.atp-view-all-top:hover { color: #1a3a0a; border-color: #1a3a0a; }
.atp-view-all-top svg { width: 15px; height: 15px; }

/* ── Product grid ───────────────────────────────────────────── */
.atp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1120px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .atp-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
    .atp-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 400px) {
    .atp-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* ── Product card ───────────────────────────────────────────── */
.atp-card {
    border: 1px solid #e4eedd;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
}
.atp-card:hover {
    box-shadow: 0 8px 28px rgba(30, 70, 10, 0.11);
    transform: translateY(-3px);
    border-color: #c8ddb0;
}

/* Image wrapper */
.atp-img-wrap {
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f5f9ef;
    overflow: hidden;
    text-decoration: none;
}
.atp-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.atp-card:hover .atp-img-wrap img {
    transform: scale(1.04);
}

/* Badge */
.atp-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 6px;
    letter-spacing: 0.3px;
    line-height: 1;
    z-index: 2;
}
.atp-badge--sale     { background: #e74c3c; color: #fff; }
.atp-badge--featured { background: #2d5a12; color: #fff; }
.atp-badge--new      { background: #0f6d56; color: #fff; }
.atp-badge--oos      { background: #888; color: #fff; top: auto; bottom: 10px; left: 10px; }

/* Card body */
.atp-info {
    padding: 14px 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
}

/* Product name */
.atp-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #0d1f06;
}
.atp-name a {
    text-decoration: none;
    color: inherit;
    transition: color 0.15s;
}
.atp-name a:hover { color: #2d5a12; }

/* Stars */
.atp-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}
.atp-stars svg {
    width: 13px;
    height: 13px;
}
.atp-rating-count {
    font-size: 11px;
    color: #8a9a7a;
    margin-left: 3px;
}

/* Price — inherits WooCommerce price classes */
.atp-price {
    font-size: 16px;
    font-weight: 700;
    color: #2d5a12;
    line-height: 1.2;
}
.atp-price del,
.atp-price .woocommerce-Price-amount.amount:first-child:not(:last-child) {
    font-size: 12px;
    color: #aaa;
    font-weight: 400;
    margin-right: 4px;
}
.atp-price ins {
    text-decoration: none;
}
.atp-price del .woocommerce-Price-amount {
    font-size: 12px !important;
    color: #bbb !important;
}

/* Add to cart button — override WooCommerce defaults for this section */
.atp-section .atp-atc-btn,
.atp-section a.button.add_to_cart_button {
    display: block !important;
    width: 100% !important;
    margin: auto 0 0 !important;
    padding: 10px 12px !important;
    background: #2d5a12 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.18s !important;
    box-shadow: none !important;
    letter-spacing: 0.2px !important;
    line-height: 1.4 !important;
}
.atp-section .atp-atc-btn:hover,
.atp-section a.button.add_to_cart_button:hover {
    background: #1e3e0d !important;
    color: #fff !important;
    transform: none !important;
}
.atp-section a.button.add_to_cart_button.loading {
    opacity: 0.75 !important;
}
.atp-section a.button.add_to_cart_button.added {
    background: #0f6d56 !important;
}
.atp-atc-btn--oos {
    background: #eee !important;
    color: #666 !important;
    cursor: default !important;
}
.atp-atc-btn--oos:hover {
    background: #eee !important;
    color: #666 !important;
}

/* ── View All footer button ─────────────────────────────────── */
.atp-footer {
    max-width: 1120px;
    margin: 36px auto 0;
    text-align: center;
}

.atp-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0d1f06;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 14px 36px;
    border-radius: 8px;
    transition: background 0.18s, transform 0.15s;
    letter-spacing: 0.2px;
}
.atp-view-all-btn:hover {
    background: #2d5a12;
    transform: translateY(-1px);
    color: #fff;
}
.atp-view-all-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Loading skeleton (shown while WC AJAX refreshes) ───────── */
@keyframes atp-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}
.atp-card.is-loading .atp-img-wrap,
.atp-card.is-loading .atp-name,
.atp-card.is-loading .atp-price,
.atp-card.is-loading .atp-atc-btn {
    background: linear-gradient(90deg, #f0f4eb 25%, #e4edd8 50%, #f0f4eb 75%);
    background-size: 400px 100%;
    animation: atp-shimmer 1.4s infinite;
    border-radius: 6px;
    color: transparent;
    pointer-events: none;
}
.atp-card.is-loading .atp-img-wrap img { opacity: 0; }

/* ── Responsive tweaks ──────────────────────────────────────── */
@media (max-width: 700px) {
    .atp-section { padding: 40px 16px 52px; }
    .atp-info { padding: 12px 10px 14px; gap: 6px; }
    .atp-name { font-size: 13px; }
    .atp-price { font-size: 14px; }

    .atp-section .atp-atc-btn,
    .atp-section a.button.add_to_cart_button {
        font-size: 12px !important;
        padding: 9px 8px !important;
    }
    .atp-view-all-btn { font-size: 14px; padding: 12px 28px; }
    .atp-view-all-top { display: none; } /* shown in footer only on mobile */
}
