/*
 * Shed Lot Manager - base styles.
 *
 * Themable values are exposed as CSS custom properties on :root.
 * Settings > Styling writes overrides for these into slm-custom.css,
 * which loads after this file - so don't edit this file directly for
 * site-specific colors/sizes, use Settings instead. Anything not
 * covered by Settings can still be overridden with plain CSS
 * targeting the classes below (see Help & Shortcodes > CSS Classes).
 */

:root {
    --slm-primary: #1d4ed8;
    --slm-primary-hover: #1a3fb0;
    --slm-title-color: #111827;
    --slm-title-font-size: 24px;
    --slm-title-font-size-mobile: var(--slm-title-font-size);
    --slm-title-transform: none;
    --slm-address-color: #374151;
    --slm-address-transform: none;
    --slm-button-bg: var(--slm-primary);
    --slm-button-color: #ffffff;
    --slm-directions-bg: var(--slm-primary);
    --slm-directions-color: #ffffff;
    --slm-button-transform: none;
    --slm-badge-bg: var(--slm-primary);
    --slm-badge-color: #ffffff;
    --slm-map-height: 420px;
}

/* Location Search widget */

.slm-search {
    border: none !important;
    background: #fff;
}

.slm-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
    margin-bottom: 16px;
    border: none !important;
}

.slm-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.slm-field input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
}

.slm-button {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    background: var(--slm-button-bg);
    color: var(--slm-button-color);
    text-transform: var(--slm-button-transform);
    cursor: pointer;
}

.slm-notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    display: none;
}

.slm-notice-warning {
    display: block;
    background: #fef3c7;
    color: #92400e;
}

.slm-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.slm-results {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.slm-map {
    min-height: var(--slm-map-height);
    height: var(--slm-map-height);
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

.slm-card {
    border: 1px solid #e6e6e6;
    padding: 12px;
    border-radius: 6px;
    background: #fafafa;
    min-width: 280px;
    max-width: 300px;
    flex: 0 0 280px;
    scroll-snap-align: start;
}

.slm-search .slm-results .slm-card h3,
.slm-search .slm-results .slm-card h3 a {
    margin: 0 0 8px;
    font-size: 20px !important;
    line-height: 1.25;
}

.slm-link,
.slm-link:visited {
    display: inline-block;
    padding: 10px 16px;
    margin-top: 12px;
    border: none;
    border-radius: 4px;
    background: var(--slm-button-bg);
    color: var(--slm-button-color);
    text-transform: var(--slm-button-transform);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: none;
}

.slm-link:hover,
.slm-link:focus {
    opacity: 0.92;
    color: var(--slm-button-color);
}

.slm-empty,
.slm-loading {
    margin: 0;
    padding: 12px;
    background: #f3f4f6;
    border-radius: 6px;
}

.slm-list {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 12px;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    min-width: max-content;
    width: max-content;
}

.slm-related-products {
    display: grid;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.slm-related-products.columns-1 { grid-template-columns: 1fr; }
.slm-related-products.columns-2 { grid-template-columns: repeat(2, 1fr); }
.slm-related-products.columns-3 { grid-template-columns: repeat(3, 1fr); }
.slm-related-products.columns-4 { grid-template-columns: repeat(4, 1fr); }
.slm-related-products.columns-5 { grid-template-columns: repeat(5, 1fr); }
.slm-related-products.columns-6 { grid-template-columns: repeat(6, 1fr); }

.slm-map-info {
    position: relative;
    padding-right: 22px;
}

.slm-map-info-close {
    position: absolute;
    top: -4px;
    right: -2px;
    border: 0;
    background: transparent;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.slm-map-info-link {
    display: inline-block;
    margin-top: 4px;
    color: var(--slm-primary);
    font-weight: 600;
    text-decoration: none;
}

.slm-map-info-link:hover,
.slm-map-info-link:focus {
    text-decoration: underline;
}

/* Location Showcase layout */

.slm-lot-showcase {
    display: flex;
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
}

.slm-lot-products {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
}

.slm-lot-products-title {
    margin: 0 0 16px;
    font-size: clamp(26px, 3vw, 40px);
    line-height: 1.1;
    color: var(--slm-title-color);
}

.slm-location-products-title {
    margin: 0 0 24px;
    font-size: clamp(22px, 2.4vw, 32px);
    line-height: 1.15;
    color: var(--slm-title-color);
}

.slm-lot-sidebar {
    flex: 0 0 360px;
    width: 100%;
    max-width: 360px;
    min-width: 0;
    order: 2;
}

.slm-lot-panel {
    border: none;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.slm-lot-panel-title,
.slm-lot-panel-location,
.slm-lot-panel-address,
.slm-lot-directions-wrap {
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.slm-lot-panel-title {
    font-size: var(--slm-title-font-size);
    line-height: 1.2;
    color: var(--slm-title-color);
}

.slm-location-title,
.slm-lot-panel-title,
.slm-lot-panel-location {
    text-transform: var(--slm-title-transform);
}

.slm-lot-panel-location {
    color: var(--slm-title-color);
    font-weight: 600;
}

.slm-lot-panel-address {
    color: var(--slm-address-color);
}

.slm-location-address,
.slm-lot-panel-address {
    text-transform: var(--slm-address-transform);
}

.slm-lot-map-single,
.slm-lot-map-fallback {
    width: 100%;
    height: var(--slm-map-height);
    min-height: var(--slm-map-height);
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    display: block;
}

.slm-lot-map-single > div,
.slm-lot-map-single iframe {
    height: 100% !important;
}

.slm-lot-directions-wrap {
    border-bottom: 0;
}

.slm-lot-directions {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 4px;
    background: var(--slm-directions-bg);
    color: var(--slm-directions-color) !important;
    text-decoration: none !important;
    font-weight: 600;
    line-height: 1.2;
    text-transform: var(--slm-button-transform);
    border: none;
    transition: opacity 0.2s ease;
}

.slm-lot-directions:hover,
.slm-lot-directions:focus {
    opacity: 0.9;
    color: var(--slm-directions-color) !important;
}

.slm-location-products-grid {
    gap: 18px;
    align-items: start !important;
}

.slm-browse-all-wrap {
    margin: 16px 0 0;
}

.slm-browse-all-link {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 4px;
    background: var(--slm-button-bg);
    color: var(--slm-button-color) !important;
    text-decoration: none;
    font-weight: 600;
    text-transform: var(--slm-button-transform);
    margin-top: 0;
}

.slm-browse-all-link:hover,
.slm-browse-all-link:focus {
    color: var(--slm-button-color) !important;
    opacity: 0.92;
}

/* Shop filter notice (shown on the shop/product archive) */

.slm-shop-filter-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    margin: 0 0 24px;
    border: 1px solid #ead7ae;
    border-radius: 8px;
    background: #f9f1dc;
    color: #3b3122;
}

.slm-shop-filter-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.slm-shop-filter-clear {
    display: inline-block;
    white-space: nowrap;
    color: var(--slm-primary);
    font-weight: 600;
    text-decoration: none;
}

.slm-shop-filter-clear:hover,
.slm-shop-filter-clear:focus {
    opacity: 0.85;
}

/* Product card styling within location product grids - includes
   compatibility overrides for common theme product-card markup
   (WooCommerce default, plus a few common theme variants). */

.slm-location-products-block .products li.product,
.slm-lot-showcase .products li.product {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    align-self: start !important;
}

.slm-location-products-block .products li.product.slm-product-card,
.slm-lot-showcase .products li.product.slm-product-card {
    display: block !important;
}

.slm-product-image-link {
    display: block;
}

.slm-product-title {
    margin: 10px 0 8px !important;
    font-size: 20px !important;
    line-height: 1.3 !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.slm-product-title a {
    color: inherit;
    text-decoration: none;
}

span.slm-product-badge {
    display: inline-block;
    background: var(--slm-badge-bg) !important;
    color: var(--slm-badge-color) !important;
    border: 0 !important;
    border-radius: 4px !important;
    padding: 5px 10px !important;
    margin-bottom: 8px !important;
    min-height: 0 !important;
    line-height: 1.1 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    opacity: 1 !important;
}

.slm-lot-sidebar,
.slm-location-map-block,
.slm-location-map-block .slm-lot-panel {
    align-self: start !important;
    display: block !important;
    justify-content: flex-start !important;
    height: auto !important;
    min-height: 0 !important;
}

.slm-location-products-block .products li.product img,
.slm-lot-showcase .products li.product img {
    border-radius: 6px;
}

.slm-lot-showcase .slm-location-map-block,
.slm-lot-showcase .slm-location-map-block .slm-lot-panel {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

.slm-lot-showcase .slm-location-map-block .slm-lot-panel {
    display: block !important;
}

.slm-lot-showcase .slm-location-map-block .slm-lot-directions-wrap,
.slm-lot-showcase .slm-lot-directions-wrap {
    margin-top: 0 !important;
}

.slm-lot-showcase .slm-location-map-card {
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

.slm-lot-showcase .slm-lot-panel {
    display: block !important;
}

.slm-lot-showcase .slm-lot-map-single {
    display: block !important;
    height: var(--slm-map-height) !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
}

.slm-lot-showcase .slm-lot-map-single > iframe,
.slm-lot-showcase iframe.slm-lot-map-fallback {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
}

.slm-location-products-block .products li.product .woocommerce-loop-product__title,
.slm-location-products-block .products li.product h2,
.slm-location-products-block .products li.product h3,
.slm-location-products-block .products li.product .wd-entities-title,
.slm-location-products-block .products li.product .product-title,
.slm-lot-showcase .products li.product .woocommerce-loop-product__title,
.slm-lot-showcase .products li.product h2,
.slm-lot-showcase .products li.product h3,
.slm-lot-showcase .products li.product .wd-entities-title,
.slm-lot-showcase .products li.product .product-title {
    font-size: 20px !important;
    line-height: 1.3 !important;
    font-family: inherit !important;
    font-weight: 700 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin-top: 10px !important;
    margin-bottom: 8px !important;
}

.slm-location-products-block .products li.product .price,
.slm-lot-showcase .products li.product .price {
    font-size: 16px !important;
    line-height: 1.3 !important;
    font-family: inherit !important;
    font-weight: 500 !important;
}

.slm-location-products-block .products li.product .price del,
.slm-lot-showcase .products li.product .price del {
    opacity: 0.65;
    font-size: 0.92em;
    margin-right: 6px;
}

.slm-location-products-block .products li.product .price del .woocommerce-Price-amount,
.slm-lot-showcase .products li.product .price del .woocommerce-Price-amount {
    text-decoration-thickness: 1.5px;
}

.slm-location-products-block .products li.product .price ins,
.slm-lot-showcase .products li.product .price ins {
    text-decoration: none;
    font-weight: 700 !important;
    color: var(--slm-primary);
}

.slm-location-products-block .products li.product .price .woocommerce-Price-amount,
.slm-lot-showcase .products li.product .price .woocommerce-Price-amount,
.slm-location-products-block .products li.product .price bdi,
.slm-lot-showcase .products li.product .price bdi {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
}

.slm-location-products-block .products li.product .price .woocommerce-Price-currencySymbol,
.slm-lot-showcase .products li.product .price .woocommerce-Price-currencySymbol {
    font-size: 1em;
    line-height: 1;
    font-weight: inherit;
}

.slm-location-products-block .products li.product .onsale,
.slm-lot-showcase .products li.product .onsale,
.slm-location-products-block .products li.product .new,
.slm-lot-showcase .products li.product .new,
.slm-location-products-block .products li.product .product-label,
.slm-lot-showcase .products li.product .product-label,
.slm-location-products-block .products li.product .wd-product-label,
.slm-lot-showcase .products li.product .wd-product-label,
.slm-location-products-block .products li.product .wd-label-new,
.slm-lot-showcase .products li.product .wd-label-new {
    background: var(--slm-primary) !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 4px !important;
    padding: 5px 10px !important;
    margin-bottom: 8px !important;
    min-height: 0 !important;
    line-height: 1.1 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    opacity: 1 !important;
}

.slm-location-products-block .products li.product .button,
.slm-location-products-block .products li.product .add_to_cart_button,
.slm-location-products-block .products li.product a.button,
.slm-lot-showcase .products li.product .button,
.slm-lot-showcase .products li.product .add_to_cart_button,
.slm-lot-showcase .products li.product a.button {
    display: none !important;
}

/* Location page (non-showcase) layout */

.slm-lot-layout {
    background: #fff;
}

.slm-location-details {
    padding: 20px;
}

.slm-location-details h3 {
    margin-bottom: 10px;
    color: var(--slm-title-color);
    text-transform: var(--slm-title-transform);
}

.slm-location-info {
    padding: 0;
}

.slm-location-title {
    margin: 0 0 10px;
    font-size: var(--slm-title-font-size);
    color: var(--slm-title-color);
}

.slm-location-address {
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--slm-address-color);
}

.slm-location-map,
.slm-location-map-block {
    width: 100%;
}

.slm-location-map-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

@media (max-width: 860px) {

    .slm-lot-showcase {
        flex-direction: column;
    }

    .slm-lot-panel-title {
        font-size: var(--slm-title-font-size-mobile);
    }

    .slm-location-title {
        font-size: var(--slm-title-font-size-mobile);
    }

    .slm-lot-sidebar {
        order: 1;
        width: 100%;
        max-width: none;
        flex: none;
    }

    .slm-lot-products {
        order: 2;
        width: 100%;
    }

    .slm-map {
        min-height: 320px;
        height: 320px;
    }

    .slm-related-products {
        grid-template-columns: 1fr;
    }

    .slm-shop-filter-notice {
        display: block;
    }

    .slm-shop-filter-clear {
        margin-top: 10px;
    }
}
