/**
 * Product Info Grid Styles
 * Location: plugins/aktd-elements/assets/css/product-info-grid.css
 * 
 * Styles for the product information sheets grid display
 * Two-column layout with filtering capabilities
 * 
 * @package AKT_Elements
 * @since 1.0.0
 */

/* Main Grid Container */
.product-info-grid {
    padding: 0;
    max-width: 100%;
    margin: 0;
    font-family: "DM Sans", sans-serif;
}

/* Grid Title */
.product-info-grid__title {
    /* Align with press archive title */
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 40px!important;
    text-align: left;
    color: var(--aktd-color-font);
    text-transform: uppercase;
    line-height: 1.2;
}

/* Filter Section */
.product-info-grid__filters {
    /* Visuals align to press (no special background/padding) */
    background: transparent;
    padding: 0;
    margin-bottom: 0;
    display: block;
}

.product-info-grid__filter-label {
    /* Match press filter label */
    font-size: 16px;
    font-weight: 700;
    color: var(--aktd-color-font);
    margin-bottom: 10px;
    line-height: 1.5;
}

.product-info-grid__filter-controls {
    /* Match press: simple block layout */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-info-grid__filter-group {
    display: block;
    width: 100%;
}

.product-info-grid__filter-sublabel {
    display: none;
}

.product-info-grid__filter-select {
    /* Copy press select styling */
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 0;
    background-color: var(--aktd-color-dark-blue-10);
    font-size: 16px;
    font-weight: 500;
    line-height: 27px;
    color: var(--aktd-color-font);
    cursor: pointer;
    transition: border-color 0.3s ease;
    height: 47px;
    align-self: stretch;
    /* Custom arrow: 20px from right */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 12px 8px;
    padding-right: 52px; /* ensure space for arrow */
}

/* Hide default arrow in IE */
.product-info-grid__filter-select::-ms-expand {
    display: none;
}

.product-info-grid__filter-select:hover,
.product-info-grid__filter-select:focus,
.product-info-grid__filter-select:active {
    /* Keep select styling constant on interaction, like press */
    outline: none;
    border-color: inherit;
    background-color: inherit;
    color: inherit;
}

/* Grid Container */
.product-info-grid__container {
    position: relative;
    min-height: 100px;
}

/* Loading Indicator */
.product-info-grid__loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    z-index: 2;
}

.product-info-grid__spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0,0,0,0.15);
    border-top-color: var(--aktd-color-dark-blue, #003a70);
    border-radius: 50%;
    animation: akt-spin 1s linear infinite;
}

@keyframes akt-spin {
    to { transform: rotate(360deg); }
}

/* Individual Grid Item */
.product-info-grid__item {
    /* Align spacing with press items */
    display: block;
    width: 100%;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Product Link */
.product-info-grid__link {
    /* Copy link look from press */
    color: var(--aktd-color-dark-blue);
    text-decoration: none !important;
    font-size: 16px;
    font-style: normal;
    line-height: 27px;
    transition: color 0.3s ease;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.product-info-grid__link:hover {
    color: var(--aktd-color-dark-blue);
    text-decoration: none;
}

.product-info-grid__link:focus {
    outline: none;
}

/* Remove PDF Icon */
.product-info-grid__link:before {
    display: none;
}

/* No Results Message */
.product-info-grid__no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 14px;
}

/* Group Headers (if needed for categories) */
/* Removed group title styling for product info grid */

/* Responsive Design */
@media screen and (max-width: 768px) {
    .product-info-grid {
        padding: 20px 15px;
    }
    
    .product-info-grid__title {
        /* Match press */
        margin-bottom: 15px;
    }
    
    .product-info-grid__filters {
        margin-bottom: 40px;
        padding: 0;
    }
    
    .product-info-grid__filter-controls {
        width: 100%;
    }
    
    .product-info-grid__filter-group {
        width: 100%;
    }
    
    .product-info-grid__filter-select {
        width: 100%;
        max-width: 100%;
    }
    
    /* Single column on mobile */
    .product-info-grid__items {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    /* Remove responsive font-size overrides; keep desktop sizes */
}

/* Print Styles */
@media print {
    .product-info-grid__filters {
        display: none;
    }
    
    .product-info-grid__items {
        grid-template-columns: 1fr;
    }
    
    .product-info-grid__link {
        color: #000;
        text-decoration: none;
    }
}

/* Accessibility */
.product-info-grid__filter-select:focus-visible,
.product-info-grid__link:focus-visible {
    outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .product-info-grid__filters {
        border: 1px solid #000;
    }
    
    .product-info-grid__filter-select {
        border: 1px solid #000;
    }
    
    .product-info-grid__link {
        text-decoration: underline;
    }
}
