/* ==========================================================================
   Mall Directory – Frontend Stylesheet  v1.1
   ========================================================================== */

/* ── Reset ── */
.mall-directory-widget,
.mall-directory-widget * {
    box-sizing: border-box;
}

.mall-directory-widget {
    font-family: inherit;
}

/* ══════════════════════════════════════════
   SEARCH BAR  –  full width, above everything
══════════════════════════════════════════ */
.md-search-wrap {
    display: flex;
    align-items: center;
    background-color: #00CBA9;
    border-radius: 30px;
    /* No outline border / box-shadow by default */
    overflow: hidden;
    margin-bottom: 20px;
    /* Remove any UA border */
    border: none;
}

.md-search-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-left: 16px;
    padding-right: 4px;
    pointer-events: none;
}

.md-search-icon svg {
    display: block;
    stroke: rgba(255,255,255,0.85);
}

.md-search-input {
    flex: 1;
    /* Kill every possible border variant browsers may add */
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-inline-start: none !important;
    border-inline-end: none !important;
    /* Force transparent – override ALL browser UA white backgrounds */
    background: transparent !important;
    background-color: transparent !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    outline: none !important;
    width: 100%;
    padding: 12px 20px 12px 8px;
    color: #ffffff;
    font-size: 15px;
    font-family: inherit;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    /* Autofill background override */
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    transition: background-color 99999s ease-in-out 0s;
}

/* Extra: kill any theme/global input border that may target the element */
.mall-directory-widget input[type="text"].md-search-input,
.mall-directory-widget input.md-search-input {
    border: none !important;
    border-left: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
}

.md-search-input::placeholder {
    color: rgba(255,255,255,0.75);
}

/* ══════════════════════════════════════════
   LAYOUT  –  sidebar + main
══════════════════════════════════════════ */
.md-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* ══════════════════════════════════════════
   FILTER SIDEBAR
══════════════════════════════════════════ */
.md-filters {
    flex: 0 0 220px;
    min-width: 180px;
    max-width: 260px;
    padding: 16px;
    background-color: #f5f5f5;
    border-radius: 12px;
    position: sticky;
    top: 20px;
}

/* ── Reset button ── */
.md-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 14px;
    background-color: #ff6b6b;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}

.md-reset-btn svg {
    stroke: #ffffff;
    flex-shrink: 0;
}

.md-reset-btn:hover {
    background-color: #e05555;
    transform: translateY(-1px);
}

.md-reset-btn:active {
    transform: translateY(0);
}

/* ── Filter group headings ── */
.md-filter-group {
    margin-bottom: 10px;
}

.md-filter-heading {
    font-weight: 700;
    font-size: 14px;
    color: #222;
    padding: 8px 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    /* White divider line by default – overridable via Elementor */
    border-bottom: 1px solid #ffffff;
    margin-bottom: 8px;
    transition: color 0.15s;
}

.md-chevron {
    flex-shrink: 0;
    vertical-align: middle;
    /* White colour is baked into SVG stroke="#ffffff" in PHP — CSS cannot override SVG presentation attrs reliably */
}

/* ── Filter item list ── */
.md-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    overflow: hidden;
    max-height: 1000px;
    transition: max-height 0.3s ease, opacity 0.2s;
    opacity: 1;
}

.md-filter-list.md-filter-collapsed {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

/* ── Individual filter buttons  –  NO shadow under any circumstance ── */
.mall-directory-widget .md-filter-btn,
.mall-directory-widget .md-filter-btn:focus,
.mall-directory-widget .md-filter-btn:active,
.mall-directory-widget .md-filter-btn:hover,
.mall-directory-widget .md-filter-btn.active {
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    outline: none !important;
}

.md-filter-btn {
    border: none;
    background: transparent;
    color: #444;
    cursor: pointer;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-family: inherit;
    transition: background-color 0.15s, color 0.15s;
    line-height: 1.4;
    text-align: left;
    width: 100%;
    display: block;
}

.md-filter-btn:hover {
    background-color: rgba(0,203,169,0.15);
    color: #00CBA9;
}

.md-filter-btn.active {
    background-color: #00CBA9;
    color: #ffffff;
}

/* Alphabet buttons – grid layout, centered */
.md-filter-alpha .md-filter-list {
    gap: 4px;
    display: flex;
    flex-wrap: wrap;
}

.md-alpha-btn {
    min-width: 26px;
    height: 26px;
    width: 26px;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
}

/* Mall filter buttons */
.md-mall-btn {
    text-align: left;
}


/* ══════════════════════════════════════════
   MAIN AREA
══════════════════════════════════════════ */
.md-main {
    flex: 1 1 auto;
    min-width: 0;
    position: relative;
}

/* ══════════════════════════════════════════
   STORE GRID
══════════════════════════════════════════ */
.md-grid {
    display: grid;
    gap: 20px;
}

.md-grid-1 { grid-template-columns: 1fr; }
.md-grid-2 { grid-template-columns: repeat(2, 1fr); }
.md-grid-3 { grid-template-columns: repeat(3, 1fr); }
.md-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
    .md-grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .md-grid-4,
    .md-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .md-layout       { flex-direction: column; }
    .md-filters      { flex: none; width: 100%; max-width: 100%; position: static; }
    .md-grid-4,
    .md-grid-3       { grid-template-columns: repeat(2, 1fr); }


}

@media (max-width: 480px) {
    .md-grid-4,
    .md-grid-3,
    .md-grid-2       { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   STORE CARD
══════════════════════════════════════════ */
.md-store-card {
    background-color: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Default shadow – overridable by Elementor Box Shadow control */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.md-store-card:hover {
    transform: translateY(-3px);
    /* Hover shadow overridden by Elementor card_shadow_hover control */
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

/* ── Store Image ── */
.md-store-image {
    height: 180px;
    overflow: hidden;
    position: relative;
    border-radius: 12px 12px 0 0;
    background-color: #e8e8e8;
    flex-shrink: 0;
}

.md-store-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.25s, transform 0.3s;
}

.md-store-card:hover .md-store-image img {
    opacity: 0.85;
    transform: scale(1.03);
}

.md-store-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.md-image-placeholder-text {
    font-size: 13px;
    color: #999;
    text-align: center;
    padding: 20px;
    font-style: italic;
    line-height: 1.5;
}

/* ── Card Footer ── */
.md-store-footer {
    background-color: #00CBA9;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0 0 12px 12px;
    gap: 8px;
    margin-top: auto;
}

.md-store-info {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.md-store-name {
    font-weight: 700;
    font-size: 14px;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.md-store-meta {
    font-size: 12px;
    color: rgba(0,0,0,0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* ── More Button ── */
.md-store-btn {
    flex-shrink: 0;
    background-color: #F5C518;
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    transition: background-color 0.2s, color 0.2s, transform 0.15s;
    text-decoration: none;
    display: inline-block;
    line-height: 1.5;
}

.md-store-btn:hover {
    background-color: #e0b000;
    color: #ffffff;
    transform: scale(1.05);
}

.md-store-btn:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
}

/* ══════════════════════════════════════════
   PAGINATION
══════════════════════════════════════════ */
.md-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 30px;
}

/* Shared base – remove ALL shadows from pagination */
.md-page-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    text-shadow: none;
}

/* Page number buttons */
.md-page-num {
    min-width: 36px;
    height: 36px;
    background-color: #f0f0f0;
    color: #444;
    font-size: 14px;
    font-weight: 600;
    border-radius: 50%;
    padding: 0 8px;
}

.md-page-num:not(.active):hover {
    background-color: #00b899;
    color: #ffffff;
}

.md-page-num.active {
    background-color: #00CBA9;
    color: #ffffff;
    cursor: default;
}

/* Prev / Next arrow buttons */
.md-page-arrow {
    width: 36px;
    height: 36px;
    background-color: #f0f0f0;
    border-radius: 50%;
    padding: 8px;
    color: #444;
}

.md-page-arrow svg {
    display: block;
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.md-page-arrow:not(:disabled):hover {
    background-color: #00CBA9;
    color: #ffffff;
}

.md-page-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

/* Ellipsis */
.md-page-ellipsis {
    color: #888;
    padding: 0 4px;
    font-size: 14px;
    line-height: 36px;
    user-select: none;
}

/* ══════════════════════════════════════════
   NO RESULTS
══════════════════════════════════════════ */
.md-no-results {
    text-align: center;
    color: #666;
    font-size: 15px;
    padding: 48px 20px;
    grid-column: 1 / -1;
    width: 100%;
}

/* ══════════════════════════════════════════
   LOADING SPINNER
══════════════════════════════════════════ */
.md-loading {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.75);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    pointer-events: none;
}

.md-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #e0e0e0;
    border-top-color: #00CBA9;
    border-radius: 50%;
    animation: md-spin 0.7s linear infinite;
}

@keyframes md-spin {
    to { transform: rotate(360deg); }
}
