/**
 * Infrapipe Search Shortcodes - Styles
 */

/* ===================== */
/* SEARCH TITLE          */
/* ===================== */
.ipm-search-title {
    margin-bottom: 24px;
}

.ipm-search-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px;
    line-height: 1.3;
}

.ipm-search-title-query {
    color: #0b670e;
}

.ipm-search-title-count {
    font-size: 15px;
    color: #666;
    margin: 0;
}

/* ===================== */
/* SEARCH FORM           */
/* ===================== */
.ipm-search-form {
    margin-bottom: 32px;
}

.ipm-search-form-inner {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
    max-width: 600px;
}

.ipm-search-form-inner:focus-within {
    border-color: #0b670e;
    box-shadow: 0 0 0 3px rgba(11, 103, 14, 0.1);
}

.ipm-search-form-icon {
    flex-shrink: 0;
    margin-left: 16px;
    color: #999;
}

.ipm-search-form-input {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    padding: 14px 12px !important;
    font-size: 16px;
    color: #333;
    box-shadow: none !important;
    margin: 0 !important;
    min-width: 0;
}

.ipm-search-form-input::placeholder {
    color: #999;
}

.ipm-search-form-button {
    flex-shrink: 0;
    padding: 14px 28px;
    background: #0b670e;
    color: #fff;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.ipm-search-form-button:hover {
    background: #228b57;
}

/* ===================== */
/* SEARCH RESULTS GRID   */
/* ===================== */
.ipm-search-grid {
    display: grid;
    gap: 24px;
}

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

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

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

/* Product card */
.ipm-search-product {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    height: 100%;
}

.ipm-search-product:hover {
    border-color: #0b670e;
    box-shadow: 0 4px 12px rgba(41, 161, 102, 0.1);
}

.ipm-search-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.ipm-search-product-image {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8f9fa;
}

.ipm-search-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.ipm-search-product:hover .ipm-search-product-image img {
    transform: scale(1.05);
}

/* Product content area */
.ipm-search-product-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category label */
.ipm-search-product-category {
    font-size: 12px;
    font-weight: 500;
    color: #0b670e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

/* Title */
.ipm-search-product-title-link {
    text-decoration: none;
    color: inherit;
}

.ipm-search-product-title-link:hover {
    color: #0b670e;
}

.ipm-search-product-title {
    font-family: 'Futura', 'Futura PT', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.4;
}

.ipm-search-product-title-link:hover .ipm-search-product-title {
    color: #0b670e;
}

/* Price */
.ipm-search-product-price {
    margin-bottom: 8px;
}

.ipm-search-product-price .amount,
.ipm-search-product-price .woocommerce-Price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.ipm-search-product-price ins {
    text-decoration: none;
}

.ipm-search-product-price ins .amount,
.ipm-search-product-price ins .woocommerce-Price-amount {
    color: #ED7354;
}

.ipm-search-product-price del {
    opacity: 0.6;
}

.ipm-search-product-price del .amount,
.ipm-search-product-price del .woocommerce-Price-amount {
    font-size: 14px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}

/* SKU */
.ipm-search-product-sku {
    font-size: 12px;
    color: #999;
    display: block;
    margin-bottom: 16px;
}

/* Add to cart button */
.ipm-search-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: auto;
    padding: 12px 20px;
    min-height: 44px;
    background: #0b670e;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    line-height: 1.4;
    box-sizing: border-box;
}

.ipm-search-add-to-cart:hover {
    background: #238c58;
    color: #fff !important;
    transform: translateY(-1px);
}

/* ===================== */
/* NO RESULTS / EMPTY    */
/* ===================== */
.ipm-search-empty,
.ipm-search-no-query {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}

.ipm-search-empty svg {
    color: #ccc;
    margin-bottom: 20px;
}

.ipm-search-empty p,
.ipm-search-no-query p {
    font-size: 17px;
    color: #666;
    margin: 0 0 24px;
}

.ipm-search-browse-btn {
    display: inline-flex;
    align-items: center;
    padding: 14px 28px;
    background: #0b670e;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: background 0.2s;
}

.ipm-search-browse-btn:hover {
    background: #228b57;
    color: #fff;
}

/* ===================== */
/* PAGINATION            */
/* ===================== */
.ipm-search-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.ipm-search-pagination a,
.ipm-search-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.ipm-search-pagination a {
    background: #f0f0f0;
    color: #333;
}

.ipm-search-pagination a:hover {
    background: #0b670e;
    color: #fff;
}

.ipm-search-pagination span.current {
    background: #0b670e;
    color: #fff;
}

.ipm-search-pagination span.dots {
    background: transparent;
    color: #999;
}

/* ===================== */
/* RESPONSIVE            */
/* ===================== */
@media (max-width: 992px) {
    .ipm-search-grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .ipm-search-grid[data-columns="4"],
    .ipm-search-grid[data-columns="3"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .ipm-search-grid {
        gap: 16px;
    }

    .ipm-search-title h1 {
        font-size: 22px;
    }

    .ipm-search-form-inner {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .ipm-search-grid[data-columns="4"],
    .ipm-search-grid[data-columns="3"],
    .ipm-search-grid[data-columns="2"] {
        grid-template-columns: 1fr;
    }

    .ipm-search-product-content {
        padding: 12px;
    }

    .ipm-search-product-sku {
        font-size: 11px;
    }

    .ipm-search-product-price .amount,
    .ipm-search-product-price .woocommerce-Price-amount {
        font-size: 16px;
    }
}
