/**
 * LV Peptides — Shop Page Styles
 *
 * Consolidated external stylesheet for the shop/archive pages.
 * Covers: grid layout, category filter bar, product card styles,
 * pagination, and responsive breakpoints.
 *
 * Enqueued conditionally on shop/archive pages via functions.php.
 *
 * @see Requirements: 5.1, 5.7, 5.8, 5.9
 */

/* ==========================================================================
   Shop Page — Light_Gray Background
   ========================================================================== */
.lv-shop-page {
    background-color: var(--lv-gray);
    padding: var(--space-12) var(--space-8);
    min-height: 60vh;
}

.lv-shop-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.lv-shop-page-title {
    text-align: center;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--lv-navy);
    margin: 0 0 var(--space-8);
}

/* ==========================================================================
   Category Filter Bar
   ========================================================================== */
.lv-category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
    padding: var(--space-4) 0;
    list-style: none;
}

.lv-category-filter li {
    margin: 0;
}

.lv-category-filter a {
    display: inline-block;
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--lv-navy);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.lv-category-filter a:hover,
.lv-category-filter a:focus {
    color: var(--lv-teal);
    border-bottom-color: var(--lv-teal);
}

.lv-category-filter a.active {
    color: var(--lv-teal);
    border-bottom-color: var(--lv-teal);
    font-weight: 600;
}


/* ==========================================================================
   Product Grid — Responsive
   ========================================================================== */
.lv-product-grid ul.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    list-style: none;
    padding: 0;
    margin: 0;
}

.lv-product-grid ul.products li.product {
    width: auto;
    float: none;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Product Card
   ========================================================================== */
.lv-product-card {
    background-color: var(--lv-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lv-product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
}

/* ==========================================================================
   Image Container — Fixed Height, object-fit: cover
   ========================================================================== */
.lv-product-card__image {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background-color: var(--lv-gray);
}

.lv-product-card__image a {
    display: block;
    width: 100%;
    height: 100%;
}

.lv-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   Card Body
   ========================================================================== */
.lv-product-card__body {
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Product Name — 2-line truncation */
.lv-product-card__title {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--lv-navy);
    margin: 0 0 var(--space-2);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lv-product-card__title a {
    color: inherit;
    text-decoration: none;
}

.lv-product-card__title a:hover {
    color: var(--lv-teal);
}

/* Price — Teal */
.lv-product-card__price {
    font-family: var(--font-family);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--lv-teal);
    margin: 0 0 var(--space-2);
}

.lv-product-card__price .woocommerce-Price-amount {
    color: var(--lv-teal);
}

.lv-product-card__price del {
    color: #999;
    font-weight: 400;
    font-size: var(--font-size-sm);
}

.lv-product-card__price ins {
    text-decoration: none;
}

/* Short Description — 2-line truncation */
.lv-product-card__description {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--lv-navy);
    line-height: 1.5;
    margin: 0 0 var(--space-4);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.75;
    flex: 1;
}


/* ==========================================================================
   Add to Cart Button — Teal bg, white text, hover darkens 10%
   ========================================================================== */
.lv-product-card__actions {
    margin-top: auto;
}

.lv-product-card__actions .button,
.lv-product-card__actions .add_to_cart_button,
.lv-product-card__actions .ajax_add_to_cart {
    display: block;
    width: 100%;
    background-color: var(--lv-teal);
    color: var(--lv-white);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-align: center;
    padding: var(--space-3) var(--space-4);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
    line-height: 1.4;
}

.lv-product-card__actions .button:hover,
.lv-product-card__actions .button:focus,
.lv-product-card__actions .add_to_cart_button:hover,
.lv-product-card__actions .add_to_cart_button:focus,
.lv-product-card__actions .ajax_add_to_cart:hover,
.lv-product-card__actions .ajax_add_to_cart:focus {
    background-color: #00bf99;
    color: var(--lv-white);
}

.lv-product-card__actions .added_to_cart {
    display: block;
    text-align: center;
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--lv-teal);
}

/* ==========================================================================
   No Products Message
   ========================================================================== */
.lv-no-products {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--lv-navy);
    font-size: var(--font-size-lg);
}

/* ==========================================================================
   WooCommerce Pagination
   ========================================================================== */
.lv-shop-page nav.woocommerce-pagination {
    margin-top: var(--space-8);
    text-align: center;
}

.lv-shop-page nav.woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    list-style: none;
    padding: 0;
    margin: 0;
}

.lv-shop-page nav.woocommerce-pagination ul li a,
.lv-shop-page nav.woocommerce-pagination ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--lv-navy);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lv-shop-page nav.woocommerce-pagination ul li a:hover,
.lv-shop-page nav.woocommerce-pagination ul li a:focus {
    background-color: var(--lv-teal);
    color: var(--lv-white);
}

.lv-shop-page nav.woocommerce-pagination ul li span.current {
    background-color: var(--lv-teal);
    color: var(--lv-white);
}

/* ==========================================================================
   Responsive — Tablet (768–1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .lv-product-grid ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Responsive — Mobile (< 768px)
   ========================================================================== */
@media (max-width: 767px) {
    .lv-shop-page {
        padding: var(--space-8) var(--space-4);
    }

    .lv-shop-page-title {
        font-size: var(--font-size-xl);
    }

    .lv-category-filter {
        gap: var(--space-1);
    }

    .lv-category-filter a {
        font-size: var(--font-size-sm);
        padding: var(--space-2) var(--space-3);
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .lv-product-grid ul.products {
        grid-template-columns: 1fr;
    }

    .lv-product-card__image {
        height: 200px;
    }
}
