/* Legal Grounds Coffee Recommender - style.css (v1.3.3) */

/* Main Recommender Container */
#lgcr-recommender-form-container {
    border: 1px solid #e0e0e0;
    padding: 25px 30px;
    margin: 30px auto;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

/* Main Title */
#lgcr-recommender-form-container h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #ededed;
    padding-bottom: 15px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 2em;
    font-weight: 600;
}

/* Form Grid for Dropdowns */
.lgcr-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns for dropdowns */
    gap: 20px 25px;
    margin-bottom: 25px;
}

/* Filter Group Styling */
.lgcr-filter-group label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 0.95em;
}
.lgcr-filter-group label i.fas {
    margin-right: 10px;
    color: #000000;
    font-size: 1.1em;
    width: 20px;
    text-align: center;
}
.lgcr-filter-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #fff;
    font-size: 1em;
    color: #495057;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 10px 10px;
    padding-right: 2.5rem;
}
.lgcr-filter-group select:focus {
    border-color: #000000;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.25);
}

/* Tasting Notes Section */
.lgcr-tasting-notes-group {
    margin-top: 10px;
    margin-bottom: 25px;
    padding-top: 15px;
    border-top: 1px solid #ededed;
}
.lgcr-tasting-notes-group label { margin-bottom: 12px; }
#lgcr-tasting-notes-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
}
.lgcr-checkbox-label {
    display: inline-flex; align-items: center; padding: 8px 15px;
    border: 1px solid #ced4da; border-radius: 25px; background-color: #fff;
    cursor: pointer; font-weight: 500; font-size: 0.9em; color: #495057;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, color 0.15s ease-in-out;
    line-height: 1.4;
}
.lgcr-checkbox-label input[type="checkbox"] {
    margin-right: 8px; width: 1em; height: 1em;
    accent-color: #000000; flex-shrink: 0;
}
.lgcr-checkbox-label:hover { background-color: #f8f9fa; border-color: #adb5bd; }
.lgcr-checkbox-label input[type="checkbox"]:focus-visible { outline: 2px solid #000000; outline-offset: 2px; }

/* Submit Button */
#lgcr-submit-filters {
    padding: 12px 25px; background-color: #000000; color: white;
    border: none; border-radius: 5px; cursor: pointer;
    font-size: 1.15em; font-weight: 600;
    transition: background-color 0.15s ease-in-out, transform 0.1s ease;
    display: block; width: 100%; margin-top: 20px;
    text-transform: uppercase; letter-spacing: 0.8px; line-height: 1.5;
}
#lgcr-submit-filters i.fas { margin-right: 10px; }
#lgcr-submit-filters:hover, #lgcr-submit-filters:focus {
    background-color: #333333; outline: none; transform: translateY(-1px);
}
#lgcr-submit-filters:active { transform: translateY(0px); }

/* Results Area */
#lgcr-results {
    margin-top: 35px; padding: 25px; background-color: #ffffff;
    border-radius: 8px; border: 1px solid #e0e0e0; min-height: 150px;
}
#lgcr-results h3 { /* "Your Coffee Suggestions" title */
    margin-top: 0; color: #2c3e50; border-bottom: 2px solid #ededed;
    padding-bottom: 15px; margin-bottom: 25px; font-size: 1.6em; font-weight: 600;
}
#lgcr-results .lgcr-initial-message {
    margin: 20px 0; line-height: 1.6; color: #555; text-align: center; font-style: italic;
}

/* Fallback Recommendation Styling - NEW */
.lgcr-fallback-recommendation {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #ccc;
}
.lgcr-fallback-recommendation h4 {
    font-size: 1.3em;
    color: #34495e;
    margin-bottom: 15px;
    text-align: center;
}
.lgcr-fallback-recommendation ul.products.columns-1 li.product {
    /* If you want the fallback product to be centered or have a max-width */
    max-width: 300px; /* Example max-width for a single item */
    margin-left: auto !important; /* Centering if max-width is set */
    margin-right: auto !important;
}
.lgcr-recommendation-text {
    font-size: 0.95em;
    color: #495057;
    line-height: 1.6;
    margin-top: 10px;
    margin-bottom: 15px;
    padding: 0 10px; /* Some horizontal padding within the card */
}


/* Loading and Notice Styling */
.lgcr-loading, #lgcr-results .woocommerce-info, #lgcr-results .woocommerce-error {
    padding: 15px 20px; border-radius: 5px; margin: 20px 0;
    clear: both; text-align: center; line-height: 1.6; font-size: 1em;
}
.lgcr-loading { background-color: #e9ecef; border: 1px solid #dee2e6; color: #495057; }
#lgcr-results .woocommerce-info { background-color: #cce5ff; border: 1px solid #b8daff; color: #004085; }
#lgcr-results .woocommerce-error { background-color: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }

/* Product List Grid Styling (3 columns default, responsive) */
#lgcr-results ul.products {
    list-style: none !important; padding: 0 !important; margin: 0 !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 25px !important;
}
#lgcr-results ul.products.columns-1 { /* For single fallback item, ensure it doesn't break */
    grid-template-columns: 1fr !important; /* Ensure single column */
}


/* Individual Product Item Styling */
#lgcr-results ul.products li.product {
    margin: 0 !important; padding: 20px; width: auto !important; text-align: center;
    background-color: #ffffff; border: 1px solid #e9ecef; border-radius: 6px;
    display: flex !important; flex-direction: column !important; justify-content: space-between !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
#lgcr-results ul.products li.product:hover {
    transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
#lgcr-results ul.products li.product a { text-decoration: none; color: inherit; }

#lgcr-results ul.products li.product .woocommerce-loop-product__title {
    font-size: 1.15em; margin: 0 0 12px 0; padding: 0; color: #2c3e50;
    line-height: 1.35; order: 1; font-weight: 600;
}
#lgcr-results ul.products li.product .woocommerce-loop-product__title a { color: #2c3e50; }
#lgcr-results ul.products li.product .woocommerce-loop-product__title a:hover { color: #000000; }

#lgcr-results ul.products li.product .lgcr-product-image-link {
    display: block; margin-bottom: 18px; order: 2;
}
#lgcr-results ul.products li.product .lgcr-product-image-link .wp-post-image {
    max-width: 100%; height: auto; border-radius: 4px;
    border: 1px solid #f1f1f1; object-fit: cover; aspect-ratio: 1 / 1;
}

#lgcr-results ul.products li.product .button {
    margin-top: auto !important; font-size: 1em; padding: 10px 15px;
    background-color: #000000 !important; color: #fff !important; border-color: #000000 !important;
    width: 100%; box-sizing: border-box; order: 3;
    border-radius: 4px; text-transform: uppercase; font-weight: 600;
    letter-spacing: 0.5px;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}
#lgcr-results ul.products li.product .button:hover {
    background-color: #333333 !important; border-color: #333333 !important; color: #fff !important;
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .lgcr-form-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 20px; }
    #lgcr-results ul.products:not(.columns-1) { /* Keep columns-1 as single */
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }
}
@media (max-width: 600px) {
    .lgcr-form-grid { grid-template-columns: 1fr !important; gap: 15px; }
    #lgcr-results ul.products:not(.columns-1) { /* Keep columns-1 as single */
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    #lgcr-recommender-form-container { padding: 20px 15px; }
    #lgcr-recommender-form-container h2 { font-size: 1.6em; }
    #lgcr-results h3 { font-size: 1.4em; }
    .lgcr-filter-group select, .lgcr-checkbox-label, #lgcr-submit-filters { font-size: 0.95em; }
    #lgcr-results ul.products li.product .woocommerce-loop-product__title { font-size: 1.05em; }
    #lgcr-results ul.products li.product .lgcr-product-image-link .wp-post-image { aspect-ratio: 4 / 3; }
}