/* ==========================================================
   1. GLOBAL & MOBILE STYLES (Loaded Everywhere / Base Mobile)
   ========================================================== */

/* Layout & Spacing */
.ast-plain-container #secondary {
    margin-top: 0;
}

.ast-article-single img, 
.woocommerce-product-gallery__wrapper {
    box-shadow: none !important;
}

/* Modern Related Products Card Setup (Base Mobile Layout) */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    background-color: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    overflow: hidden;
    transition: all 0.3s ease;
}

.woocommerce ul.products li.product img,
.woocommerce-page ul.products li.product img {
    box-shadow: none;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Premium Primary Call to Action Button */
.woocommerce-js div.product form.cart .button.single_add_to_cart_button {
    padding: 14px 28px;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

/* Utility Rule Hide Out of Stock Labels */
.out-of-stock-product .price + .ast-shipping-text {
    display: none;
}

/* --- Base Specifications Mobile Layout (Card Style) --- */
.specification {
    width: 100%;
    border-collapse: separate;
    margin: 1.5em 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.specification tr,
.specification th,
.specification td {
    border: 0;
}

.specification tr {
    display: block;
    background: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.specification th {
    display: block;
    background: #005744;
    color: #ffffff;
    font-weight: 600;
    padding: 10px 14px;
    font-size: 0.95rem;
}

.specification td {
    display: block;
    padding: 12px 14px;
    font-size: 0.9rem;
    color: #4a5568;
    background: #ffffff;
}

.specification tr:nth-child(odd) td {
    background-color: #f7f9fa; 
}

.per25, .per16, .per12 {
    width: 100% !important;
}

.ipdf { 
    width: 24px; 
}	

.woocommerce-product-attributes.shop_attributes td {
    width: 100%;
    display: block;
}


/* ==========================================================
   2. DESKTOP UPGRADES (Only Applies to Screens 769px and Up)
   ========================================================== */

@media (min-width: 769px) {

    /* Interactions upgraded for hover environments */
    .woocommerce ul.products li.product:hover,
    .woocommerce-page ul.products li.product:hover {
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
    }

    .woocommerce ul.products li.product:hover img,
    .woocommerce-page ul.products li.product:hover img {
        transform: scale(1.06);
    }

    /* Convert Specification Layout from Mobile Cards to Two-Column Matrices */
    .specification {
        display: table; /* Reverts grid system back to structured table row style */
        border-spacing: 0 8px; 
    }

    .specification tr {
        display: table-row;
    }

    .specification th {
        display: table-cell;
        text-align: left;
        padding: 12px 16px;
        width: 25%;
        border-radius: 6px;
    }

    .specification td {
        display: table-cell;
        padding: 12px 16px;
        border-radius: 0 6px 6px 0;
    }

    /* Column layout variations for desktop views */
    .per25 { width: 25% !important; }
    .per16 { width: 16% !important; }
    .per12 { width: 12% !important; }

    .ipdf { 
        width: 36px; 
    }	
	
    .woocommerce-product-attributes.shop_attributes td {
        width: 50%;
        display: table-cell;
    }
}


/* Mobile Responsive Rules for Related Products */

@media (max-width: 768px) {
    /* Step 1: Force the related products grid into 1 single column */
    .site-main .related.products ul.products {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
        display: flex !important;
        flex-direction: column;
    }

    /* Step 2: Hide all related products except for the very first one */
    .site-main .related.products ul.products li.product {
        display: none !important;
    }
    .site-main .related.products ul.products li.product:first-child {
        display: block !important;
        width: 100% !important;
        margin-right: 0 !important;
    }
}

