/* =============================================
   WSB - Woo Shop Builder for Elementor
   Brand: Delft Blue #142d60 · Blue Green #209bbc
   Headings: Laila · Body: Raleway · Product price: Figtree
   ============================================= */

.wsb-shop-layout {
    --wsb-delft-blue: #142d60;
    --wsb-blue-green: #209bbc;
    --wsb-text-body: #272727;
    --wsb-font-heading: "Laila", sans-serif;
    --wsb-font-body: "Raleway", sans-serif;
    --wsb-font-price: "Figtree", sans-serif;

    display: flex;
    gap: 28px;
    align-items: flex-start;
    font-family: var(--wsb-font-body);
    font-size: 15px;
    line-height: 1.5;
    color: var(--wsb-text-body);
}
.wsb-shop-layout.wsb-sidebar-right { flex-direction: row-reverse; }
.wsb-shop-layout.wsb-no-sidebar .wsb-main-area { width: 100%; }

/* --- Main Area --- */
.wsb-main-area { flex: 1; min-width: 0; }

/* =============================================
   TOOLBAR
   ============================================= */
.wsb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 0 18px;
    border-bottom: 1px solid rgba(20, 45, 96, 0.12);
    margin-bottom: 20px;
}
.wsb-result-count {
    font-family: var(--wsb-font-body);
    font-size: 14px;
    color: var(--wsb-text-body);
}
.wsb-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Sorting */
.wsb-sort-select {
    font-family: var(--wsb-font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--wsb-delft-blue);
    border: 1px solid rgba(20, 45, 96, 0.25);
    background: #fff;
    padding: 7px 28px 7px 10px;
    border-radius: 4px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23142d60'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.wsb-sort-select:focus { outline: none; border-color: var(--wsb-blue-green); }

/* Search */
.wsb-search-wrap { position: relative; display: flex; align-items: center; }
.wsb-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--wsb-delft-blue);
    display: flex;
    align-items: center;
    line-height: 1;
}
.wsb-search-btn:hover { color: var(--wsb-blue-green); }
.wsb-search-box {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 99;
    margin-top: 6px;
}
.wsb-search-box.wsb-open { display: block; }
.wsb-search-input {
    width: 220px;
    border: 1px solid rgba(20, 45, 96, 0.2);
    border-radius: 4px;
    padding: 7px 12px;
    font-family: var(--wsb-font-body);
    font-size: 14px;
    color: var(--wsb-text-body);
    background: #fff;
    box-shadow: 0 4px 12px rgba(20, 45, 96, 0.08);
}
.wsb-search-input:focus { outline: none; border-color: var(--wsb-blue-green); }

/* Grid Switcher — column density as vertical bars (||| |||| …) */
.wsb-view-switcher { display: flex; align-items: center; gap: 6px; }
.wsb-view-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    color: rgba(20, 45, 96, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    min-width: 32px;
    min-height: 28px;
}
.wsb-view-btn:hover,
.wsb-view-btn.wsb-active { color: var(--wsb-delft-blue); background: rgba(32, 155, 188, 0.12); }

.wsb-layout-bars {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 16px;
}
.wsb-layout-bars > i {
    display: block;
    width: 3px;
    border-radius: 1px;
    background: currentColor;
    flex-shrink: 0;
}
.wsb-layout-bars-2 > i { height: 12px; }
.wsb-layout-bars-3 > i { height: 14px; }
.wsb-layout-bars-4 > i { height: 15px; }
.wsb-layout-bars-5 > i { height: 16px; width: 2px; }

/* List = horizontal rows */
.wsb-layout-bars-list {
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    width: 16px;
    height: 14px;
    gap: 0;
}
.wsb-layout-bars-list > i {
    width: 100%;
    height: 2px;
    border-radius: 1px;
}

/* Per Page (legacy — hidden unless old markup present) */
.wsb-per-page { display: flex; align-items: center; gap: 6px; font-family: var(--wsb-font-body); font-size: 13px; color: var(--wsb-text-body); }
.wsb-pp-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #bbb;
    padding: 0 2px;
    font-family: inherit;
    transition: color 0.15s;
}
.wsb-pp-btn:hover,
.wsb-pp-btn.wsb-active { color: #222; font-weight: 600; }

/* =============================================
   PRODUCT GRID
   ============================================= */
.wsb-products-grid {
    display: grid;
    gap: 16px;
    transition: all 0.25s ease;
}
.wsb-cols-2  { grid-template-columns: repeat(2, 1fr); }
.wsb-cols-3  { grid-template-columns: repeat(3, 1fr); }
.wsb-cols-4  { grid-template-columns: repeat(4, 1fr); }
.wsb-cols-5  { grid-template-columns: repeat(5, 1fr); }
.wsb-cols-list { grid-template-columns: 1fr; }

@media (max-width: 1100px) {
    .wsb-cols-5 { grid-template-columns: repeat(3, 1fr); }
    .wsb-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .wsb-shop-layout { flex-direction: column !important; }
    .wsb-sidebar { width: 100% !important; }
    .wsb-cols-5,
    .wsb-cols-4,
    .wsb-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .wsb-cols-5,
    .wsb-cols-4,
    .wsb-cols-3,
    .wsb-cols-2 { grid-template-columns: 1fr; }
}

/* =============================================
   PRODUCT CARD
   ============================================= */
.wsb-product-card {
    background: #fff;
    border: 1px solid rgba(32, 155, 188, 0.25);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    position: relative;
}
.wsb-product-card:hover {
    box-shadow: 0 8px 24px rgba(20, 45, 96, 0.12);
    border-color: rgba(20, 45, 96, 0.2);
    transform: translateY(-2px);
}

/* Image */
.wsb-product-img {
    position: relative;
    overflow: hidden;
}
.wsb-product-img a { display: block; }
.wsb-product-img img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.wsb-product-card:hover .wsb-product-img img {
    transform: scale(1.04);
}

/* Badges */
.wsb-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--wsb-delft-blue);
    color: #fff;
    font-family: var(--wsb-font-body);
    font-size: 9px;
    font-weight: 700;
    padding: 5px 12px;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    border-radius: 0 0 6px 0;
    z-index: 2;
    line-height: 1;
}
.wsb-badge-bestseller { background: var(--wsb-delft-blue); }

.wsb-discount-badge {
    position: absolute;
    top: 30px;
    left: 8px;
    background: var(--wsb-blue-green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 4px;
    z-index: 2;
    line-height: 1;
}

/* Card body — title above price (homepage order) */
.wsb-product-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
}
.wsb-product-price { order: 2; }
.wsb-in-stock { order: 3; }
.wsb-add-to-cart { order: 4; }

/* Product price — Figtree (matches WooCommerce .amount markup) */
.wsb-product-price {
    font-family: "Figtree", sans-serif !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    color: #272727 !important;
    line-height: 1.3;
    margin-bottom: 6px;
}
.wsb-product-price .woocommerce-Price-amount,
.wsb-product-price .amount,
.wsb-product-price span {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}
.wsb-product-price del {
    color: rgba(39, 39, 39, 0.45) !important;
    margin-right: 6px;
    font-weight: 600 !important;
    font-size: 16px !important;
}
.wsb-product-price ins {
    text-decoration: none !important;
    font-weight: 700 !important;
    color: #272727 !important;
}

/* Product title — Laila */
.wsb-product-title {
    order: 1;
    color: #142d60 !important;
    font-family: "Laila", sans-serif !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 25px !important;
    margin: 0 0 6px;
}
.wsb-product-title a {
    color: #142d60 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-decoration: none;
}
.wsb-product-title a:hover { color: var(--wsb-blue-green) !important; }

.wsb-in-stock {
    display: block;
    font-family: var(--wsb-font-body);
    font-size: 11px;
    font-weight: 700;
    color: var(--wsb-blue-green);
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Add to Cart */
.wsb-add-to-cart {
    display: none;
    width: 100%;
    padding: 10px 0;
    background: var(--wsb-delft-blue);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-family: var(--wsb-font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.15s;
    box-sizing: border-box;
}
.wsb-product-card:hover .wsb-add-to-cart { display: block; }
.wsb-add-to-cart:hover { background: #0f2248; color: #fff; }

/* List view override */
.wsb-cols-list .wsb-product-card {
    display: flex;
    flex-direction: row;
}
.wsb-cols-list .wsb-product-img { width: 200px; flex-shrink: 0; }
.wsb-cols-list .wsb-product-img img { height: 160px; }
.wsb-cols-list .wsb-product-body { flex: 1; padding: 20px; }
.wsb-cols-list .wsb-add-to-cart { display: inline-block; width: auto; padding: 8px 20px; }

/* =============================================
   PAGINATION
   ============================================= */
.wsb-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.wsb-page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(20, 45, 96, 0.2);
    background: #fff;
    border-radius: 4px;
    font-family: var(--wsb-font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--wsb-delft-blue);
    transition: all 0.15s;
}
.wsb-page-btn:hover { border-color: var(--wsb-blue-green); color: var(--wsb-delft-blue); }
.wsb-page-btn.wsb-active {
    background: var(--wsb-delft-blue);
    color: #fff;
    border-color: var(--wsb-delft-blue);
}

/* No products */
.wsb-no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    font-family: var(--wsb-font-body);
    color: rgba(39, 39, 39, 0.55);
    font-size: 15px;
}

/* Loading overlay */
.wsb-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.wsb-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(32, 155, 188, 0.2);
    border-top-color: var(--wsb-blue-green);
    border-radius: 50%;
    animation: wsb-spin 0.7s linear infinite;
}
@keyframes wsb-spin { to { transform: rotate(360deg); } }

/* =============================================
   SIDEBAR
   ============================================= */
.wsb-sidebar {
    width: 260px;
    flex-shrink: 0;
}

/* Filter Block */
.wsb-filter-block {
    border: 1.5px solid rgba(20, 45, 96, 0.15);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
    background: #fff;
}
.wsb-filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    font-family: var(--wsb-font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--wsb-delft-blue);
    cursor: pointer;
    user-select: none;
}
.wsb-collapse-btn {
    font-size: 18px;
    font-weight: 300;
    color: var(--wsb-blue-green);
    line-height: 1;
}
.wsb-filter-body {
    padding: 0 16px 16px;
    font-family: var(--wsb-font-body);
    font-size: 14px;
    color: var(--wsb-text-body);
}
.wsb-filter-body.wsb-collapsed { display: none; }

/* Price Range Slider */
.wsb-price-range-wrap {
    position: relative;
    margin: 16px 0 14px;
    height: 20px;
}
.wsb-range-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(32, 155, 188, 0.25);
    border-radius: 2px;
    pointer-events: none;
}
.wsb-range-selected {
    position: absolute;
    height: 100%;
    background: var(--wsb-blue-green);
    border-radius: 2px;
}
.wsb-range-min,
.wsb-range-max {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
}
.wsb-range-min::-webkit-slider-thumb,
.wsb-range-max::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wsb-delft-blue);
    pointer-events: all;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(20, 45, 96, 0.35);
}
.wsb-range-min::-moz-range-thumb,
.wsb-range-max::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--wsb-delft-blue);
    pointer-events: all;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(20, 45, 96, 0.35);
}

.wsb-price-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}
.wsb-filter-apply-btn {
    background: var(--wsb-delft-blue);
    color: #fff;
    border: none;
    padding: 8px 16px;
    font-family: var(--wsb-font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.7px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
.wsb-filter-apply-btn:hover { background: #0f2248; }
.wsb-price-label {
    font-family: var(--wsb-font-body);
    font-size: 12px;
    color: var(--wsb-text-body);
}
.wsb-price-label .woocommerce-Price-amount { color: inherit; }

/* Color Filter */
.wsb-color-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 4px 0;
    font-family: var(--wsb-font-body);
    font-size: 14px;
    color: var(--wsb-text-body);
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.wsb-color-row:hover { background: rgba(32, 155, 188, 0.08); }
.wsb-color-row.wsb-active {
    color: var(--wsb-delft-blue);
    font-weight: 600;
    background: rgba(32, 155, 188, 0.15);
    border-color: rgba(20, 45, 96, 0.22);
    box-shadow: inset 3px 0 0 var(--wsb-delft-blue);
}
/* Checkboxes: not :empty (ZWSP in HTML), inline-block + SVG tick — survives theme span:empty rules */
.wsb-shop-layout .wsb-color-check {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 2px solid rgba(20, 45, 96, 0.4) !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    background-image: none !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wsb-shop-layout .wsb-color-row.wsb-active .wsb-color-check {
    border: 2px solid var(--wsb-delft-blue) !important;
    box-shadow: 0 0 0 1px rgba(20, 45, 96, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23142d60' d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") !important;
    background-size: 14px 14px !important;
}
.wsb-color-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.wsb-color-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    transition: box-shadow 0.15s;
}
.wsb-color-row.wsb-active .wsb-color-dot {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wsb-blue-green);
}
.wsb-color-count { color: rgba(39, 39, 39, 0.45); font-size: 12px; margin-left: auto; }
.wsb-color-row.wsb-active .wsb-color-count { color: var(--wsb-delft-blue); }

/* Category Filter */
.wsb-cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 4px 0;
    font-family: var(--wsb-font-body);
    font-size: 14px;
    color: var(--wsb-text-body);
    cursor: pointer;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.wsb-cat-item:hover { background: rgba(32, 155, 188, 0.08); color: var(--wsb-delft-blue); }
.wsb-cat-item.wsb-active {
    color: var(--wsb-delft-blue);
    font-weight: 600;
    background: rgba(32, 155, 188, 0.15);
    border-color: rgba(20, 45, 96, 0.22);
    box-shadow: inset 3px 0 0 var(--wsb-delft-blue);
}
.wsb-shop-layout .wsb-cat-check {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 2px solid rgba(20, 45, 96, 0.4) !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    background-image: none !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.wsb-shop-layout .wsb-cat-item.wsb-active .wsb-cat-check {
    border: 2px solid var(--wsb-delft-blue) !important;
    box-shadow: 0 0 0 1px rgba(20, 45, 96, 0.1);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23142d60' d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") !important;
    background-size: 14px 14px !important;
}
.wsb-cat-toggle {
    margin-left: auto;
    font-size: 14px;
    color: #bbb;
    line-height: 1;
}
.wsb-cat-children { padding-left: 12px; }

.wsb-color-row:focus-visible,
.wsb-cat-item:focus-visible {
    outline: 2px solid var(--wsb-blue-green);
    outline-offset: 2px;
}

/* =============================================
   ELEMENTOR EDITOR STYLES
   ============================================= */
.elementor-editor-active .wsb-add-to-cart { display: block; }
