
/* ==========================
Controls
=========================== */
.controls {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.controls button {
    padding: 0.1rem 0.3rem;
    border: 1px solid #ddd;
    background: #f3f4f6;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}

.controls button:hover {
    background: #e5e7eb;
}

.controls button.active {
    background: #FF9800;
    color: white;
    border-color: #FF9800;
}

/* ==========================
Stores Container
=========================== */
.stores-container {
    display: grid;
    gap: 0.7rem;
}

.stores-container.grid {
    grid-template-columns: repeat(4, 1fr);
}

.stores-container.list {
    grid-template-columns: repeat(3, 1fr);
}

/* ==========================
Store Card
=========================== */
.stores-card {
    background: #ffffff;
    border-radius: 3px;
    padding: 1.5rem;
    border: 1px solid #eaeaea;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.stores-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #ff9902;
}

.store-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border: 2px solid #e5e7eb;
    background: white;
}

.stores-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #111827;
    margin-bottom: 0.25rem;
}

.category-container {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.category-tag {
    background-color: #e5e7eb;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.details-container {
    margin-top: 1rem;
    color: #4b5563;
    text-align: center;
}

.delivery-info,
.distance-info {
    font-size: 0.875rem;
    font-weight: 500;
}

.distance-info {
    margin-top: 0.25rem;
    color: #2563eb;
}

/* ==========================
List View Layout
=========================== */
.stores-container.list .stores-card,
.stores-container.list .stores-card-product {
    display: flex;            /* ทำเป็น flex row */
    flex-direction: row;      
    align-items: center;      /* จัดกลางแนวตั้ง */
    text-align: left;         /* ตัวหนังสือชิดซ้าย */
    gap: 1rem;                /* ระยะห่างระหว่าง logo กับข้อมูล */
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
}

.stores-container.list .store-logo,
.stores-container.list .store-logo-product {
    width: 80px;             /* ปรับขนาดโลโก้ */
    height: 80px;
    object-fit: contain;
    margin: 0;               /* ลบ margin เดิม */
    flex-shrink: 0;          /* ไม่ให้ logo ย่อ */
}

.stores-container.list .stores-name,
.stores-container.list .category-container,
.stores-container.list .details-container {
    text-align: left;
}

.stores-container.list .category-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-start;
    margin-top: 0.25rem;
}

.stores-container.list .details-container {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #555;
}

/* ==========================
Pagination
=========================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.pagination button {
    padding: 0.1rem 0.6rem;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pagination button:hover {
    background: #f3f4f6;
}

.pagination button.active {
    background: #FF9800;
    color: white;
    border-color: #FF9800;
}

.pagination button:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    color: #9ca3af;
}

/* ==========================
Showing Entries
=========================== */
.showing-entries {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #374151;
}

/* ==========================
Sidebar
=========================== */


/* ==========================
Responsive
=========================== */
@media (max-width: 1024px) {

    .stores-container.grid,
    .stores-container.list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {

    .stores-container.grid,
    .stores-container.list {
        grid-template-columns: 1fr;
    }

    .stores-container.list .stores-card {
        flex-direction: row;
    }
}


/* ==========================
My Stores
=========================== */
.stores-card-info {
    display: flex;
    gap: 15px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    /* max-width: 400px; */
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); */
    flex-direction: column;
    margin-bottom: 10px;
}

.stores-logo-info {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: contain;
    margin-bottom: 0.75rem;
    border: 2px solid #e5e7eb;
    background: white;
}

#stores-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#stores-menu li a {
    font-size: 14px;
    padding: 5px 10px;
    text-decoration: none;
    color: black;
    display: block;
    border-radius: 0.5rem;
}

#stores-menu li a:hover {
    background-color: #FF9800;
    padding: 5px 10px;
    color: #ffffff;
}

#stores-menu li a.active {
    font-weight: bold;
    color: #FF9800;
    background-color: #fff7eb;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 5px;
}

/* header ของหมวดหมู่ */
.cat-header {
    font-size: 14px;
    padding: 8px 10px;
    cursor: pointer;
    position: relative;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.cat-header:hover {
    background: #eee;
}

.cat-sub-menu a {
    text-decoration: none !important;
}

/* sub menu */
.sidebar li ul {
    display: none;
    margin: 5px 0 10px 15px;
    padding-left: 10px;
    border-left: 1px solid #ddd;
}

.sidebar li.open>ul {
    display: block;
}

/* ลูกศร */
.cat-header::after {
    content: "▸";
    position: absolute;
    right: 10px;
    transition: transform 0.3s;
}

.sidebar li.open>.cat-header::after {
    transform: rotate(90deg);
}

/* ==========================
Store Card Product
=========================== */
.stores-card-product {
    background: #ffffff;
    border-radius: 3px;
    padding: 0.5rem;
    border: 1px solid #eaeaea;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

.stores-card-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #ff9902;
}

.store-logo-product {
    width: 100%;
    height: auto;
    min-height: 145px;
    max-height: 145px;
    object-fit: cover;
    margin-bottom: 0.75rem;
    /* border: 1px solid #e5e7eb; */
    background: white;
}

.stores-name-product {
    font-size: 14px;
    font-weight: bold;
    color: #555;
    margin-bottom: 0.25rem;
}

.category-container-product {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.category-tag-product {
    background-color: #e5e7eb;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    white-space: nowrap;
}

.details-container-product {
    margin-top: 1rem;
    color: #4b5563;
    text-align: center;
}

.delivery-info-product,
.distance-info-product {
    font-size: 0.875rem;
    font-weight: 500;
}

.distance-info-product {
    margin-top: 0.25rem;
    color: #2563eb;
}

/* ==========================
priceRangeContainer
=========================== */
#priceRangeContainer {
    position: relative;
    height: 14px;
    background: #e9ecef;
    border-radius: 10px;
    margin-bottom: 1rem;
}

#priceRangeSelected {
    position: absolute;
    height: 100%;
    background: #ff9800;
    border-radius: 10px;
    transition: left 0.1s, width 0.1s;
}

.range-slider {
    width: 100%;
    margin: 0;
    -webkit-appearance: none;
    background: transparent;
    position: absolute;
    top: -3px;
    pointer-events: auto;
    height: 20px;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #ffa322;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 2;
}