/* ==========================================================================
   Product Grid Layout Styles
   ========================================================================== */

/* Grid Wrapper */
.woo-product-grid-wrapper {
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 40px 20px !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
}

/* Grid Header - High specificity to override theme styles */
.woo-product-grid-wrapper .grid-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    padding-bottom: 20px !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: none !important;
    box-shadow: none !important;
}

.woo-product-grid-wrapper .grid-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
}

.woo-product-grid-wrapper .grid-header-right {
    display: flex !important;
    align-items: center !important;
}

.woo-product-grid-wrapper .grid-title,
.woo-product-grid-wrapper h2.grid-title {
    font-size: 28px !important;
    font-weight: 600 !important;
    color: #1a1a1a !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.woo-product-grid-wrapper .grid-sort-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.woo-product-grid-wrapper .grid-sort-wrapper .sort-icon {
    color: #6b7280 !important;
    flex-shrink: 0 !important;
    fill: none !important;
}

.woo-product-grid-wrapper .grid-sort-wrapper .sort-label {
    font-size: 14px !important;
    color: #6b7280 !important;
    font-weight: 400 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.woo-product-grid-wrapper .grid-sort-wrapper .grid-sort-select,
.woo-product-grid-wrapper select.grid-sort-select {
    font-size: 14px !important;
    color: #1a1a1a !important;
    font-weight: 400 !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    line-height: 1.5 !important;
    height: auto !important;
    min-height: auto !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.woo-product-grid-wrapper .grid-sort-wrapper .grid-sort-select:hover,
.woo-product-grid-wrapper select.grid-sort-select:hover {
    color: #000000 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.woo-product-grid-wrapper .grid-sort-wrapper .grid-sort-select:focus,
.woo-product-grid-wrapper select.grid-sort-select:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.woo-product-grid-wrapper .grid-header-right .product-count,
.woo-product-grid-wrapper .product-count {
    font-size: 14px !important;
    color: #6b7280 !important;
    font-weight: 400 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Product Grid */
.product-grid {
    display: grid !important;
    gap: 30px !important;
    width: 100% !important;
}

/* Grid Column Classes */
.product-grid.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.product-grid.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr) !important;
}

.product-grid.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr) !important;
}

.product-grid.grid-cols-5 {
    grid-template-columns: repeat(5, 1fr) !important;
}

.product-grid.grid-cols-6 {
    grid-template-columns: repeat(6, 1fr) !important;
}

/* Grid Product Card */
.grid-product-card {
    background: #ffffff !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
}

.grid-product-card:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
}

/* Grid product cards inherit all styles from carousel product cards */
/* No additional styles needed - using carousel-style.css classes */

/* Pagination Styles */
.wpc-pagination {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 40px !important;
    padding: 20px 0 !important;
}

.wpc-page-btn,
.wpc-page-number {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 8px 12px !important;
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    color: #1f2937 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.wpc-page-btn:hover,
.wpc-page-number:hover {
    background: #f3f4f6 !important;
    border-color: #9ca3af !important;
    transform: translateY(-2px) !important;
}

.wpc-page-number.wpc-current-page {
    background: #000000 !important;
    border-color: #000000 !important;
    color: #ffffff !important;
    cursor: default !important;
}

.wpc-page-number.wpc-current-page:hover {
    transform: none !important;
}

.wpc-page-btn svg {
    width: 16px !important;
    height: 16px !important;
    stroke: currentColor !important;
}

.wpc-page-dots {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    color: #9ca3af !important;
    font-weight: 600 !important;
    user-select: none !important;
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .product-grid.grid-cols-6,
    .product-grid.grid-cols-5 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 992px) {
    .product-grid.grid-cols-6,
    .product-grid.grid-cols-5,
    .product-grid.grid-cols-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .product-grid.grid-cols-6,
    .product-grid.grid-cols-5,
    .product-grid.grid-cols-4,
    .product-grid.grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .woo-product-grid-wrapper {
        padding: 20px 15px !important;
    }
    
    .product-grid {
        gap: 20px !important;
    }
    
    .woo-product-grid-wrapper .grid-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
    }
    
    .woo-product-grid-wrapper .grid-header-left {
        width: 100% !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    .woo-product-grid-wrapper .grid-header-right {
        width: 100% !important;
        justify-content: flex-start !important;
    }
    
    .woo-product-grid-wrapper .grid-title,
    .woo-product-grid-wrapper h2.grid-title {
        font-size: 24px !important;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* Responsive Pagination Styles */
@media (max-width: 768px) {
    .wpc-pagination {
        gap: 6px !important;
        padding: 15px 0 !important;
    }
    
    .wpc-page-btn,
    .wpc-page-number {
        min-width: 36px !important;
        height: 36px !important;
        padding: 6px 10px !important;
        font-size: 13px !important;
    }
    
    .wpc-page-btn svg {
        width: 14px !important;
        height: 14px !important;
    }
}

@media (max-width: 576px) {
    .wpc-pagination {
        gap: 4px !important;
        flex-wrap: wrap !important;
    }
    
    .wpc-page-btn,
    .wpc-page-number {
        min-width: 32px !important;
        height: 32px !important;
        padding: 4px 8px !important;
        font-size: 12px !important;
    }
    
    .wpc-page-dots {
        min-width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 400px) {
    .wpc-pagination {
        gap: 3px !important;
    }
    
    /* Hide non-essential page numbers on very small screens */
    .wpc-page-number:not(.wpc-current-page) {
        display: none !important;
    }
    
    /* Show only current page and navigation buttons */
    .wpc-page-number.wpc-current-page {
        display: inline-flex !important;
    }
    
    /* Hide ellipsis on very small screens */
    .wpc-page-dots {
        display: none !important;
    }
    
    /* Make prev/next buttons more prominent */
    .wpc-page-btn {
        min-width: 40px !important;
        height: 40px !important;
    }
}
