/* ========================================
   BANSHY SHOP STYLES - MODERN ECO DESIGN
   ======================================== */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ========================================
   WOOCOMMERCE 3-COLUMN LAYOUT - COMPACT & MODERN
   ======================================== */

/* Target our specific products grid */
ul.banshy-products-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem !important;
    margin: 2rem 0 3rem !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
    clear: both !important;
    grid-auto-flow: dense !important;
    max-width: 1100px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Remove ::before and ::after from the UL itself */
ul.banshy-products-grid::before,
ul.banshy-products-grid::after {
    display: none !important;
    content: none !important;
}

/* Reset ALL product items to work with CSS Grid */
ul.banshy-products-grid li.product,
ul.banshy-products-grid li.product.first,
ul.banshy-products-grid li.product.last,
ul.banshy-products-grid li.product:nth-child(3n+1),
ul.banshy-products-grid li.product:nth-child(3n+2),
ul.banshy-products-grid li.product:nth-child(3n+3),
ul.banshy-products-grid li.product:nth-child(3n) {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    float: none !important;
    clear: none !important;
    box-sizing: border-box !important;
    position: static !important;
    max-width: none !important;
    min-width: 0 !important;
    grid-column: auto !important;
    grid-column-start: auto !important;
    grid-column-end: auto !important;
}

/* Remove ::before and ::after pseudo-elements that break the grid */
ul.banshy-products-grid li.product::before,
ul.banshy-products-grid li.product::after {
    display: none !important;
    content: none !important;
}

/* ========================================
   SHOP LAYOUT
   ======================================== */

/* Shop Header */
.shop-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

.shop-title {
    font-family: 'Inter', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary, #2d5016);
    margin-bottom: 1rem;
}

.shop-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    color: var(--color-text-muted, #666);
    margin: 0;
}

/* Shop Controls - All in one row */
.shop-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid #e5e5e5;
    flex-wrap: wrap;
}

/* Result count styling */
.woocommerce-result-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Category Filter */
.category-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-dropdown {
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #333;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    min-width: 180px;
}

.category-dropdown:hover {
    border-color: #2d5016;
}

.category-dropdown:focus {
    outline: none;
    border-color: #2d5016;
    box-shadow: 0 0 0 2px rgba(45, 80, 22, 0.1);
}

/* WooCommerce ordering select styling */
.woocommerce-ordering select {
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #333;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.woocommerce-ordering select:hover {
    border-color: #2d5016;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: #2d5016;
    box-shadow: 0 0 0 2px rgba(45, 80, 22, 0.1);
}

/* ========================================
   PRODUCT GRID - CLEAN & SIMPLE
   ======================================== */

/* Target ALL possible WooCommerce product containers */
.woocommerce ul.products,
.woocommerce-page ul.products,
body.woocommerce ul.products,
body.woocommerce-page ul.products,
.woocommerce .products,
.woocommerce-page .products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
    clear: both !important;
    float: none !important;
}

/* Individual Product Items */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product,
.woocommerce .products li.product,
.woocommerce-page .products li.product {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    clear: none !important;
    max-width: none !important;
    box-sizing: border-box !important;
    position: static !important;
}

/* ========================================
   PRODUCT CARD STYLING - MODERN ECO-FRIENDLY DESIGN
   ======================================== */

/* Product Card Container - Compact & Modern */
ul.banshy-products-grid li.product {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    display: flex !important;
    flex-direction: column;
    height: 100%;
    max-width: 100%;
    min-height: 0;
}

/* Hide empty, draft, or products without content */
ul.banshy-products-grid li.product:empty,
ul.banshy-products-grid li.product.status-draft,
ul.banshy-products-grid li.product.status-pending,
ul.banshy-products-grid li.product.post-159 {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Hide products that have no real content - only pseudo-elements */
ul.banshy-products-grid li.product:not(:has(img)) {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
}

ul.banshy-products-grid li.product:not(:has(.woocommerce-loop-product__title)) {
    display: none !important;
    position: absolute !important;
    left: -9999px !important;
}

ul.banshy-products-grid li.product:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(45, 80, 22, 0.1);
}

/* Product Link */
ul.banshy-products-grid li.product .woocommerce-loop-product__link,
ul.banshy-products-grid li.product a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Product Image Container */
ul.banshy-products-grid li.product .woocommerce-loop-product__link > a:first-child,
ul.banshy-products-grid li.product > a:first-child {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    background: #f5f5f5;
    display: block;
    width: 100%;
}

/* Product Image */
ul.banshy-products-grid li.product img,
ul.banshy-products-grid li.product .attachment-woocommerce_thumbnail {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    transition: transform 0.3s ease;
    border-radius: 0;
    margin: 0 !important;
    display: block !important;
}

ul.banshy-products-grid li.product:hover img {
    transform: scale(1.05);
}

/* Product Title - Compact with Fixed Height */
ul.banshy-products-grid li.product .woocommerce-loop-product__title,
ul.banshy-products-grid li.product h2,
ul.banshy-products-grid li.product h2 a {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    margin: 0.6rem 0.6rem 0.4rem !important;
    line-height: 1.2 !important;
    text-align: center !important;
    flex-grow: 0 !important;
    padding: 0 !important;
    min-height: 2.2rem !important;
    max-height: 2.2rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
}

/* Product Price - PROPERLY CENTERED */
ul.banshy-products-grid li.product .price,
ul.banshy-products-grid li.product .product-price {
    font-family: 'Inter', sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #2d5016 !important;
    margin: 0 !important;
    padding: 0 0 0.6rem 0 !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    min-height: 1.8rem !important;
}

/* Add to Cart / Options Button - Compact & Modern */
ul.banshy-products-grid li.product .button,
ul.banshy-products-grid li.product a.button {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c59 100%) !important;
    color: white !important;
    border: none !important;
    padding: 0.65rem 1rem !important;
    border-radius: 0 0 8px 8px !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 600 !important;
    font-size: 0.8rem !important;
    text-transform: none !important;
    letter-spacing: 0.2px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    text-align: center !important;
    margin: 0 !important;
    margin-top: auto !important;
    display: block !important;
    text-decoration: none !important;
    box-shadow: none !important;
    min-height: 2.5rem !important;
    line-height: 1.2 !important;
}

ul.banshy-products-grid li.product .button:hover,
ul.banshy-products-grid li.product a.button:hover {
    background: linear-gradient(135deg, #1f3a0f 0%, #3a5f47 100%);
    transform: none;
}

/* Sale Badge */
ul.banshy-products-grid li.product .onsale {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e53e3e;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ========================================
   PAGINATION & CONTROLS SPACING
   ======================================== */

/* Result count and ordering */
.woocommerce-result-count,
.woocommerce-ordering {
    margin-bottom: 1.5rem;
}

/* Pagination container */
.woocommerce-pagination,
nav.woocommerce-pagination {
    margin-top: 3rem !important;
    margin-bottom: 2rem !important;
    padding: 2rem 0 !important;
    border-top: 1px solid #e5e5e5;
}

/* Pagination links */
.woocommerce-pagination ul.page-numbers {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.woocommerce-pagination ul.page-numbers li {
    margin: 0;
}

.woocommerce-pagination ul.page-numbers li a,
.woocommerce-pagination ul.page-numbers li span {
    display: inline-block;
    padding: 0.5rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #2d5016;
    font-weight: 500;
    transition: all 0.2s ease;
}

.woocommerce-pagination ul.page-numbers li a:hover {
    background: #2d5016;
    color: white;
    border-color: #2d5016;
}

.woocommerce-pagination ul.page-numbers li span.current {
    background: #2d5016;
    color: white;
    border-color: #2d5016;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet: 2 columns */
@media (max-width: 1024px) {
    ul.banshy-products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem 1.5rem !important;
    }
    
    .shop-title {
        font-size: 2.5rem;
    }
}

/* Mobile: 1 column */
@media (max-width: 640px) {
    ul.banshy-products-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .shop-title {
        font-size: 2rem;
    }
    
    .shop-subtitle {
        font-size: 1rem;
    }
    
    ul.banshy-products-grid li.product .woocommerce-loop-product__title,
    ul.banshy-products-grid li.product h2 {
        font-size: 1rem;
    }
    
    ul.banshy-products-grid li.product .price {
        font-size: 1.2rem;
    }
}