/* ==========================================
   ACMS All Stores Stylesheet
   ========================================== */

.acms-all-stores-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    padding: 20px 15px;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    width: 100%;
}

/* ==========================================
   Left Sidebar Alphabet Filter
   ========================================== */

.acms-stores-filter-sidebar {
    flex: 0 0 240px;
    width: 240px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.acms-stores-filter-title {
    font-size: 16px;
    font-weight: 700;
    color: #222222;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #741FA2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.acms-alphabet-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.acms-alphabet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: #333333;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-sizing: border-box;
    text-decoration: none;
}

/* All button styling (pill) */
.acms-alphabet-btn.is-all {
    width: auto;
    min-width: 50px;
    padding: 0 14px;
    border-radius: 19px;
}

.acms-alphabet-btn:hover {
    background-color: #8A32BA;
    color: #ffffff;
}

.acms-alphabet-btn.is-active {
    background-color: #741FA2;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(116, 31, 162, 0.2);
}

.acms-alphabet-btn.is-disabled,
.acms-alphabet-btn.is-disabled:hover {
    background-color: #f5f5f5;
    color: #aaaaaa;
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================
   Right Main Section Store List
   ========================================== */

.acms-stores-main-content {
    flex: 1;
    position: relative;
    min-width: 0; /* Prevents flex items from overflowing */
}

/* Loading State styles */
.acms-stores-main-content.acms-loading .acms-stores-grid-wrapper,
.acms-stores-main-content.acms-loading .acms-stores-pagination-wrapper {
    opacity: 0.4;
    pointer-events: none;
}

.acms-stores-loader {
    display: none;
    position: absolute;
    top: 100px;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.acms-stores-main-content.acms-loading .acms-stores-loader {
    display: block;
}

.acms-stores-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(116, 31, 162, 0.1);
    border-radius: 50%;
    border-top-color: #741FA2;
    animation: acms-spin 0.8s linear infinite;
}

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

/* Grid layout */
.acms-stores-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

/* Card Styling */
.acms-store-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.acms-store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.acms-store-card-logo {
    flex-shrink: 0;
}

.acms-store-card-logo-img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eef0f2;
    display: block;
    background: #ffffff;
}

.acms-store-card-logo-fallback {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    background-color: #f3e5f5;
    color: #741FA2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    border: 1px solid #e1bee7;
    box-sizing: border-box;
}

.acms-store-card-content {
    flex: 1;
    min-width: 0;
}

.acms-store-card-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #222222;
    line-height: 1.3;
}

.acms-store-card-description {
    font-size: 14px;
    color: #666666;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acms-store-card-action {
    flex-shrink: 0;
}

.acms-visit-store-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 30px;
    background-color: #741FA2;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(116, 31, 162, 0.15);
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.acms-visit-store-btn:hover {
    background-color: #5E1885;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(116, 31, 162, 0.25);
}

/* Empty State */
.acms-stores-empty {
    text-align: center;
    padding: 60px 40px;
    background: #ffffff;
    border: 1px dashed #cccccc;
    border-radius: 12px;
}

.acms-stores-empty-icon {
    color: #cccccc;
    margin-bottom: 16px;
}

.acms-stores-empty h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333333;
}

.acms-stores-empty p {
    margin: 0;
    color: #777777;
    font-size: 14px;
}

/* Pagination */
.acms-stores-pagination-wrapper {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.acms-stores-pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 6px;
    margin: 0 3px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    color: #555555;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.acms-stores-pagination-wrapper .page-numbers.current,
.acms-stores-pagination-wrapper .page-numbers:hover:not(.dots) {
    background-color: #741FA2;
    border-color: #741FA2;
    color: #ffffff;
}

.acms-stores-pagination-wrapper .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

.acms-pag-arrow {
    font-size: 16px;
}

/* ==========================================
   Responsive Adjustments
   ========================================== */

/* Tablet (reduce spacing only) */
@media (max-width: 991px) {
    .acms-all-stores-container {
        gap: 20px;
        padding: 15px 10px;
    }
    .acms-stores-filter-sidebar {
        flex: 0 0 200px;
        width: 200px;
        padding: 16px;
    }
    .acms-alphabet-btn {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }
    .acms-alphabet-btn.is-all {
        min-width: 44px;
        padding: 0 10px;
    }
    .acms-store-card {
        padding: 16px;
        gap: 16px;
    }
}

/* Mobile (Must keep side-by-side structure) */
@media (max-width: 767px) {
    .acms-all-stores-container {
        gap: 10px;
        padding: 10px 5px;
    }
    /* Shrink the sidebar significantly to leave space for the list */
    .acms-stores-filter-sidebar {
        flex: 0 0 54px;
        width: 54px;
        padding: 8px 4px;
    }
    .acms-stores-filter-title {
        display: none; /* Hide heading to save space */
    }
    .acms-alphabet-list {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }
    .acms-alphabet-btn {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    .acms-alphabet-btn.is-all {
        min-width: 30px;
        width: 30px;
        padding: 0;
        border-radius: 50%;
        font-size: 9px;
    }
    
    /* Stack elements vertically INSIDE the store card */
    .acms-store-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }
    .acms-store-card-logo-img,
    .acms-store-card-logo-fallback {
        width: 80px;
        height: 80px; /* Slightly smaller for mobile layout */
    }
    .acms-store-card-logo-fallback {
        font-size: 26px;
    }
    .acms-store-card-name {
        font-size: 16px;
        margin-bottom: 4px;
    }
    .acms-store-card-description {
        font-size: 13px;
        line-height: 1.4;
    }
    .acms-visit-store-btn {
        padding: 8px 16px;
        font-size: 13px;
        width: 100%;
        text-align: center;
    }
    .acms-store-card-action {
        width: 100%;
    }
}
