/* WooCommerce Product Rules - Custom Error Message Styling */

/* Target WooCommerce error notices specifically from our plugin */
.woocommerce-error,
.woocommerce .woocommerce-error,
.woocommerce-page .woocommerce-error {
    background-color: #fff3cd !important;
    color: #856404 !important;
    padding: 15px 20px !important;
    margin: 20px 0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    font-size: 18px !important;
    line-height: 1.6 !important;
    display: block !important;
    font-family: 'Prometo', sans-serif !important;
    text-align: center !important;
}

/* Hide WooCommerce's default icon */
.woocommerce-error::before,
.woocommerce .woocommerce-error::before,
.woocommerce-page .woocommerce-error::before {
    display: none !important;
}

/* Add Font Awesome warning icon to list items - centered above text */
.woocommerce-error li::before, .woocommerce .woocommerce-error li::before, .woocommerce-page .woocommerce-error li::before {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
    font-weight: 900 !important;
    content: "\f071" !important;
    display: block !important;
    color: #ff9800 !important;
    font-size: 48px !important;
    line-height: 1.6 !important;
    margin-bottom: 0px !important;
    text-align: center !important;
}

/* Style links within error messages */
.woocommerce-error a,
.woocommerce .woocommerce-error a,
.woocommerce-page .woocommerce-error a {
    color: #d68910 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: color 0.2s ease !important;
}

.woocommerce-error a:hover,
.woocommerce .woocommerce-error a:hover,
.woocommerce-page .woocommerce-error a:hover {
    color: #b9770e !important;
    text-decoration: none !important;
}

/* Style product links container for better display - grid layout */
.wprules-product-links {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, max-content)) !important;
    gap: 20px !important;
    margin-top: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-content: center !important;
    justify-items: center !important;
}



/* Individual product item spacing - styled as cards/buttons */
.wprules-product-item {
    display: block !important;
    margin: 0 !important;
}

.wprules-product-links a {
    color: #856404 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, color 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    background-color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
    cursor: pointer !important;
    overflow: hidden !important;
    height: 100% !important;
    width: 100% !important;
    max-width: 150px !important;
}

.wprules-product-links a:hover {
    background-color: #fff8e1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
    transform: translateY(-2px) !important;
    color: #b9770e !important;
    text-decoration: none !important;
}

/* Product thumbnail styling */
.wprules-product-thumbnail {
    width: 100% !important;
    height: 150px !important;
    object-fit: contain !important;
    object-position: center !important;
    border-radius: 8px 8px 0px 0px !important;
    flex-shrink: 0 !important;
    display: block !important;
    margin: 0 !important;
    padding: 8px !important;
    box-sizing: border-box !important;
    transition: background-color 0.3s ease !important;
}

@media (max-width: 768px) {
    .wprules-product-thumbnail {
        padding: 2px !important;
    }
}

/* Placeholder for products without thumbnails */
.wprules-product-thumbnail-placeholder {
    width: 100% !important;
    height: 150px !important;
    background-color: inherit !important;
    border: none !important;
    border-radius: 8px 8px 0px 0px !important;
    flex-shrink: 0 !important;
    display: block !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    transition: background-color 0.3s ease !important;
}

@media (max-width: 768px) {
    .wprules-product-thumbnail-placeholder {
        padding: 2px !important;
    }
}

/* Product title wrapper */
.wprules-product-title {
    display: block !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    text-align: center !important;
    flex: 1 !important;
}

/* Style strong tags (product names) in error messages */
.woocommerce-error strong,
.woocommerce .woocommerce-error strong,
.woocommerce-page .woocommerce-error strong {
    color: #856404 !important;
    font-weight: 600 !important;
}

/* Ensure proper spacing and layout - centered */
.woocommerce-error li,
.woocommerce .woocommerce-error li,
.woocommerce-page .woocommerce-error li {
    margin: 0 0 10px !important;
    padding: 0 !important;
    list-style: none !important;
    display: block !important;
    width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    text-align: center !important;
}

/* Ensure the error message container displays properly */
.woocommerce-error ul,
.woocommerce .woocommerce-error ul,
.woocommerce-page .woocommerce-error ul {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}


/* Cart page specific styling */
.woocommerce-cart .woocommerce-error {
    margin-bottom: 30px !important;
}

/* Single product page styling */
.single-product .woocommerce-error {
    margin-top: 0px !important;
    margin-bottom: 0px !important;
}

/* Shop/archive page styling */
.woocommerce-shop .woocommerce-error,
.archive.woocommerce-page .woocommerce-error {
    margin: 20px 0 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .woocommerce-error,
    .woocommerce .woocommerce-error,
    .woocommerce-page .woocommerce-error {
        padding: 12px 15px !important;
        font-size: 16px !important;
        margin: 0px 0 !important;
    }
    .wprules-product-links {
        grid-template-columns: repeat(auto-fit, minmax(150px, max-content)) !important;
        column-gap: 0px !important;
        row-gap: 20px !important;
        justify-content: center !important;
        justify-items: center !important;
        max-width: 100% !important;
    }
    .wprules-product-links a {
        max-width: 120px !important;
        width: 100% !important;
    }
    .wprules-product-thumbnail,
    .wprules-product-thumbnail-placeholder {
        height: 120px !important;
        padding: 4px !important;
    }
    .wprules-product-title {
        font-size: 14px !important;
        padding: 10px 12px !important;
    }
}

