/* Alynt Products Grid Styles */

.alynt-pg-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Filters Section */
.alynt-pg-filters {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

/* Category Filters */
.alynt-pg-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.alynt-pg-category-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.alynt-pg-category-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.alynt-pg-category-btn.active {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.alynt-pg-category-btn.disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.alynt-pg-category-btn.disabled:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    cursor: not-allowed;
}

.alynt-pg-category-count {
    margin-left: 0.25rem;
    font-weight: normal;
}

/* Search and Reset */
.alynt-pg-search-wrapper {
    margin-bottom: 1rem;
}

.alynt-pg-search {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.alynt-pg-search:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.alynt-pg-reset-btn {
    padding: 0.75rem 1.5rem;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.alynt-pg-reset-btn:hover {
    background: #c82333;
}

/* Results Count */
.alynt-pg-results-count {
    margin-bottom: 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Loading Spinner */
.alynt-pg-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.alynt-pg-spinner-inner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: alynt-pg-spin 1s linear infinite;
}

@keyframes alynt-pg-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Products Grid */
.alynt-pg-products-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
    grid-template-columns: repeat(var(--columns), 1fr);
}

/* Product Card */
.alynt-pg-product-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.alynt-pg-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Product Image */
.alynt-pg-product-image {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #f8f9fa;
}

.alynt-pg-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.alynt-pg-product-image:hover img {
    transform: scale(1.05);
}

.alynt-pg-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Product Categories */
.alynt-pg-product-categories {
    padding: 0.75rem 1rem 0.5rem;
}

.alynt-pg-product-category {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0 0.25rem 0.25rem 0;
    background: #e9ecef;
    color: #495057;
    font-size: 0.75rem;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 500;
}

/* Product Title */
.alynt-pg-product-title {
    margin: 0;
    padding: 0 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.alynt-pg-product-title a {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s ease;
}

.alynt-pg-product-title a:hover {
    color: #007cba;
}

/* Pricing Tier Section */
.alynt-pg-pricing-tier {
    text-align: center;
    margin-top: auto;
    margin-bottom: 0;
}

.alynt-pg-tier-label {
    display: block;
    padding: 0.5rem 1rem;
    background: #e1cdb5;
    color: #281408;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Product Footer */
.alynt-pg-product-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    border-top: 1px solid #f1f3f4;
    background: #fafbfc;
    margin-top: 0;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.alynt-pg-product-price {
    font-weight: 700;
    color: #212529;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.alynt-pg-product-price .woocommerce-Price-amount {
    font-size: 1.1rem;
}

/* Clean up any remaining pricing labels (fallback) */
.alynt-pg-product-price small,
.alynt-pg-product-price .customer-group-label {
    display: none !important;
}

.alynt-pg-product-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.alynt-pg-add-to-cart-btn {
    padding: 0.5rem;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

.alynt-pg-add-to-cart-btn:hover {
    background: #218838;
    color: #fff;
    text-decoration: none;
}

.alynt-pg-out-of-stock {
    padding: 0.5rem 1rem;
    background: #6c757d;
    color: #fff;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Pagination */
.alynt-pg-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.alynt-pg-page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.alynt-pg-page-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    text-decoration: none;
}

.alynt-pg-page-btn.active {
    background: #007cba;
    border-color: #007cba;
    color: #fff;
}

.alynt-pg-ellipsis {
    padding: 0.5rem 0.25rem;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 992px) {
    .alynt-pg-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .alynt-pg-category-filters {
        justify-content: center;
    }
}

/* Add to cart button centering for smaller screens */
@media (max-width: 599px) {
    .alynt-pg-product-actions {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .alynt-pg-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .alynt-pg-filters {
        padding: 1rem;
    }
    
    .alynt-pg-category-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .alynt-pg-product-image {
        height: 250px;
    }
}

@media (max-width: 689px) {
    .alynt-pg-products-grid {
        grid-template-columns: 1fr;
    }
    
    .alynt-pg-category-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .alynt-pg-category-btn {
        text-align: center;
    }
    
    .alynt-pg-product-footer {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }
    
    .alynt-pg-product-price {
        text-align: center;
    }
    
    .alynt-pg-add-to-cart-btn {
        text-align: center;
    }
    
    .alynt-pg-pagination {
        gap: 0.25rem;
    }
    
    .alynt-pg-page-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* Custom breakpoints support */
.alynt-pg-container[data-breakpoint-5="1400"] {
    --bp5: 1400px;
}

.alynt-pg-container[data-breakpoint-4="1200"] {
    --bp4: 1200px;
}

.alynt-pg-container[data-breakpoint-3="900"] {
    --bp3: 900px;
}

.alynt-pg-container[data-breakpoint-2="600"] {
    --bp2: 600px;
}

/* Dynamic breakpoints will be handled by JavaScript */

/* No Products Message */
.alynt-pg-no-products {
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.alynt-pg-no-products p {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.alynt-pg-no-products small {
    font-size: 0.875rem;
    color: #868e96;
    display: block;
    margin-top: 0.5rem;
}

/* Add to Cart Button States */
.alynt-pg-add-to-cart-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.alynt-pg-add-to-cart-btn.view-cart {
    background: #007cba;
}

.alynt-pg-add-to-cart-btn.view-cart:hover {
    background: #005a87;
}

/* Small Spinner for Button */
.alynt-pg-spinner-small {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: alynt-pg-spin 1s linear infinite;
    margin-right: 5px;
}

/* Notifications */
.alynt-pg-notification {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: alynt-pg-slide-in 0.3s ease-out;
}

.alynt-pg-notification-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alynt-pg-notification-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alynt-pg-notification-message {
    flex: 1;
}

.alynt-pg-notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin-left: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.alynt-pg-notification-close:hover {
    opacity: 1;
}

@keyframes alynt-pg-slide-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Popup */
.alynt-pg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.alynt-pg-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.alynt-pg-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 300px;
}

.alynt-pg-modal-message {
    font-size: 1.1rem;
    font-weight: 500;
    color: #155724;
    margin: 0;
}

/* Hide WooCommerce auto-generated View cart buttons in our product cards */
.alynt-pg-product-card .added_to_cart {
    display: none !important;
}
