/* -----------------------------------------------------------
   AYURCALL · AYURVEDIC MEDICINES LISTING PAGE
   Unified Coral 2025 Design System
   ----------------------------------------------------------- */

.medicine-listing.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #222;
}

/* ---------- Filter Bar ---------- */

.filters-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 28px;
    align-items: flex-end;
}

.filter-section {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.filter-label {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
}

.filter-select {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

    .filter-select:focus {
        border-color: #ff6f61;
        box-shadow: 0 0 0 3px rgba(255,111,97,0.15);
    }

/* ---------- Product Grid ---------- */

.medicine-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ---------- Product Card ---------- */

.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* fade-in animation for new cards */
    opacity: 0;
    transform: translateY(8px);
    animation: cardFadeIn 0.35s ease forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card img {
    width: 100%;
    height: auto;
    border-radius: 12px 12px 0 0;
}

.product-name {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 15px;
    margin: 8px 10px 4px;
    color: #222;
    min-height: 38px;
}

/* ---------- Price Row ---------- */

.price-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 10px 0;
    flex-wrap: wrap;
}

.mrp {
    text-decoration: line-through;
    color: #888;
    font-size: 13px;
}

.sale {
    color: #e46d4b;
    font-weight: 600;
    font-size: 14px;
}

.discount {
    color: #2e7d32;
    font-size: 12px;
    margin-left: auto;
}

/* ---------- Quantity & Add Actions ---------- */

.qty-actions {
    margin: 8px 10px 12px;
}

.qty-row {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-bottom: 6px;
}

.qty-btn {
    background: #f8f8f8;
    border: 1px solid #ddd;
    color: black;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}


.qty-input {
    width: 40px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    background: #fff;
    color: #222;
}

.add-btn {
    background: #ff6f61;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    width: 100%;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: background 0.2s ease;
    cursor: pointer;
}


    .add-btn.added {
        background: #28a745 !important;
        color: #fff;
        font-weight: 700;
        transform: scale(1.03);
    }

/* ---------- Pagination (Responsive / Overflow-safe) ---------- */

.pagination-wrap {
    margin-top: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.pagination {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    max-width: 100%;
}

    .pagination li {
        flex: 0 0 auto;
    }

        .pagination li a,
        .pagination li span {
            display: block;
            padding: 8px 14px;
            border-radius: 8px;
            font-size: 14px;
            text-decoration: none;
            color: #333;
            border: 1px solid #ddd;
            min-width: 36px;
            text-align: center;
            transition: all 0.2s ease;
            background: #fff;
        }

        .pagination li.active span {
            background-color: #ff6f61;
            color: #fff;
            border-color: #ff6f61;
        }

/* ---------- Load More Button (Mobile) ---------- */

.load-more-wrap {
    text-align: center;
    margin-top: 28px;
}

.load-more-btn {
    background-color: #ff6f61;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

    .load-more-btn:disabled {
        background-color: #ffb6a5;
        cursor: not-allowed;
    }

/* ---------- Responsiveness ---------- */

@media (min-width: 769px) {
    .load-more-wrap {
        display: none;
    }
    /* hide Load More on desktop */
}

@media (max-width: 768px) {
    .pagination-wrap {
        display: none;
    }
    /* hide numeric pagination */
    .filters-wrap {
        flex-direction: column;
        gap: 14px;
    }

    .filter-section {
        width: 100%;
    }

    .medicine-cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .product-name {
        font-size: 14px;
        margin: 6px 8px 2px;
    }

    .add-btn {
        padding: 6px 10px;
        font-size: 14px;
    }

    .qty-btn, .qty-input {
        width: 26px;
        height: 26px;
    }

    .pagination-wrap {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

        .pagination-wrap::-webkit-scrollbar {
            display: none;
        }

    .pagination {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
        padding: 0 6px;
    }
    .load-more-wrap,
    .load-more-btn {
        visibility: hidden;
        opacity: 0;
        height: 1px;
        margin: 0;
        padding: 0;
        border: none;
    }

}

@media (max-width: 480px) {
    .medicine-listing.container {
        padding: 12px;
    }

    .filters-wrap {
        margin-bottom: 18px;
    }

    .product-card {
        border-radius: 10px;
    }

    .pagination li a,
    .pagination li span {
        padding: 5px 8px;
        font-size: 12px;
        border-radius: 6px;
        min-width: 28px;
    }
}

/* ---------- Mobile Sticky Cart Footer ---------- */
.mobile-cart-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    display: flex; 
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
    border-top: 1px solid #eee;
    font-family: 'Inter', sans-serif;
}

.cart-footer-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-total {
    font-size: 16px;
    font-weight: 600;
    color: #e46d4b;
}

.cart-footer-btn {
    background: #ff6f61;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    padding: 8px 16px;
    font-size: 15px;
    transition: background 0.2s ease;
}

    .cart-footer-btn:hover {
        background: #e46d4b;
    }

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-cart-footer {
        display: none !important;
    }
}

/* ---------- Animation for newly loaded cards ---------- */
.product-card {
    opacity: 0;
    transform: translateY(8px);
    animation: cardFadeIn 0.35s ease forwards;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagination li span {
    cursor: default;
}

.pagination li span,
.pagination li a {
    min-width: 32px;
}

/* ============================================================
   RESPONSIVE PAGINATION / LOAD MORE TOGGLE
   ------------------------------------------------------------ */

/* Hide Load More on desktop */
@media (min-width: 769px) {
    .load-more-wrap {
        display: none !important;
    }
}

/* Hide pagination on mobile */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .load-more-wrap {
        display: block;
        text-align: center;
        margin-top: 20px;
    }

    .load-more-btn {
        display: inline-block;
        padding: 10px 24px;
        font-size: 15px;
        background-color: var(--coral-500);
        color: #fff;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        transition: background-color 0.2s ease, transform 0.2s ease;
    }


        .load-more-btn:disabled {
            background-color: #ffb6a5;
            cursor: not-allowed;
        }
}

.medicine-cards-grid.loading {
    transition: opacity 0.3s ease;
    opacity: 0.6;
}