/* WooCommerce Odoo Bridge - Frontend Styles */

.woo-odoo-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.woo-odoo-search-container .search-title {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
    font-weight: 600;
}

/* Search Form */
.woo-odoo-search-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.search-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
}

.search-field label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.search-field input[type="text"] {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.search-field input[type="text"]:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.field-description {
    margin-top: 5px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.search-button {
    padding: 12px 30px !important;
    background: #0073aa !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.3s !important;
    white-space: nowrap;
}

.search-button:hover {
    background: #005a87 !important;
}

.search-button:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
}

/* Search Loader */
.search-loader {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.loader-spinner {
    margin: 0 auto 20px;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.search-loader p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Search Results */
.search-results {
    margin-top: 30px;
}

.results-header {
    background: #fff;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: 2px solid #0073aa;
    margin-bottom: 20px;
}

.results-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 22px;
}

.results-info {
    color: #666;
    font-size: 14px;
}

.products-grid {
    display: grid;
    gap: 25px;
    margin-top: 20px;
}

.products-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.products-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.products-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Product Item */
.woo-odoo-product-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.woo-odoo-product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.woo-odoo-product-item:hover .product-image img {
    transform: scale(1.05);
}

.product-details {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.4;
}

.product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.product-title a:hover {
    color: #0073aa;
}

.product-sku {
    font-size: 12px;
    color: #999;
    margin: 0 0 15px 0;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 10px;
}

.product-price del {
    color: #999;
    font-size: 16px;
    margin-right: 10px;
}

.product-price ins {
    text-decoration: none;
    color: #d9534f;
}

.product-location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.product-location .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.product-stock {
    margin-bottom: 15px;
    font-size: 14px;
}

.in-stock {
    color: #5cb85c;
    font-weight: 600;
}

.out-of-stock {
    color: #d9534f;
    font-weight: 600;
}

.product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.product-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.product-actions .button {
    flex: 1;
    text-align: center;
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

.add-to-cart-button {
    background: #0073aa;
    color: white !important;
    border: 2px solid #0073aa;
}

.add-to-cart-button:hover {
    background: #005a87;
    border-color: #005a87;
}

.view-details-button {
    background: white;
    color: #0073aa !important;
    border: 2px solid #0073aa;
}

.view-details-button:hover {
    background: #f8f9fa;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 8px;
}

.no-results p {
    font-size: 18px;
    color: #666;
    margin: 20px 0 0 0;
}

.no-results .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #ddd;
}

/* Error Message */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .products-grid[data-columns="3"],
    .products-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .search-row {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: 1fr !important;
    }
    
    .woo-odoo-search-form {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .woo-odoo-search-container {
        padding: 10px;
    }
    
    .product-actions {
        flex-direction: column;
    }
}
