/* -------------------------------------------------------------
 * Custom Stylesheet for Andhra Pradesh Portal - Merchants Module
 * Handles Merchants Directory (Listing) and Merchant Detail (Storefront)
 * ------------------------------------------------------------- */

/* =============================================================
   1. MERCHANTS DIRECTORY / LISTING PAGE STYLES
   ============================================================= */

/* Filter Pills */
.merchant-filter-pills .nav-link {
    color: #102942;
    padding: 4px 12px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.merchant-filter-pills .nav-link.active {
    background-color: #102942 !important;
    color: #ffffff !important;
    border-color: #102942;
}
.merchant-filter-pills .nav-link:hover:not(.active) {
    background-color: #f1f5f9;
}
.merchant-filter-pills::-webkit-scrollbar {
    display: none;
}
.nav-item {
    width: auto !important;
}

/* Merchant Grid Card */
.merchant-grid-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #eef2f6;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.merchant-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}
.merchant-card-banner {
    width: 100%;
    height: 110px;
    background: linear-gradient(135deg, #102942 0%, #0d4b91 60%, #078346 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}
.merchant-card-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.4));
}
.merchant-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(16, 41, 66, 0.85);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    z-index: 2;
}
.merchant-card-logo-wrap {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: #ffffff;
    border: 2.5px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: -22px;
    left: 16px;
    z-index: 3;
    overflow: hidden;
    padding: 4px;
}
.merchant-card-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.merchant-card-logo-placeholder {
    width: 100%;
    height: 100%;
    color: #078346;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.merchant-card-body {
    padding: 30px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.merchant-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #102942;
    margin: 0 0 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.merchant-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}
.merchant-card-title a:hover {
    color: #078346;
}
.merchant-card-category {
    font-size: 12px;
    color: #078346;
    font-weight: 600;
    margin-bottom: 8px;
}
.merchant-card-loc {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.merchant-card-about {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.45;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.merchant-card-stats {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.stat-pill {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.merchant-card-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid #f1f4f8;
}
.btn-view-merchant {
    background-color: #078346;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 600;
    padding: 8px 5px;
    border-radius: 8px;
    text-decoration: none;
    flex: 1;
    text-align: center;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-view-merchant:hover {
    background-color: #066e3b;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(7, 131, 70, 0.25);
}
.btn-quick-contact {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}
.btn-quick-contact:hover {
    transform: scale(1.06);
    color: #ffffff;
}
.bg-whatsapp-btn { background-color: #25d366; }
.bg-call-btn { background-color: #0d4b91; }

.hover-text-blue:hover {
    color: #0d4b91 !important;
}

/* =============================================================
   2. MERCHANT DETAIL / STOREFRONT PAGE STYLES
   ============================================================= */

.merchant-detail-page {
    background-color: #f6f8fb;
    /* min-height: calc(100vh - 180px); */
    padding-bottom: 70px;
}

/* Main Profile Shell */
.md-profile-shell {
    max-width: 820px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f6;
    overflow: hidden;
}

/* Banner & Overlapping Logo */
.md-banner-wrap {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #102942 0%, #0d4b91 50%, #078346 100%);
    background-size: cover;
    background-position: center;
    position: relative;
}
.md-banner-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.35));
}
.md-banner-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(16, 41, 66, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
    z-index: 2;
}

/* Header Content with Overlapping Logo */
.md-header-content {
    padding: 0 24px 20px;
    position: relative;
}
.md-logo-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: -50px;
    margin-bottom: 14px;
    position: relative;
    z-index: 3;
}
.md-logo-wrap {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    background: #ffffff;
    border: 3.5px solid #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.md-logo-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.md-logo-placeholder {
    width: 100%;
    height: 100%;
    color: #078346;
    font-size: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.md-header-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}
.btn-action-pill {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}
.btn-action-whatsapp {
    background-color: #25d366;
    color: #ffffff;
}
.btn-action-whatsapp:hover {
    background-color: #20bd5a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}
.btn-action-call {
    background-color: #078346;
    color: #ffffff;
}
.btn-action-call:hover {
    background-color: #066e3b;
    color: #ffffff;
}
.btn-action-enquiry {
    background-color: #0d6efd;
    color: #ffffff;
    border: none;
    cursor: pointer;
}
.btn-action-enquiry:hover {
    background-color: #0b5ed7;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Business Title & Details */
.md-biz-name {
    font-size: 22px;
    font-weight: 800;
    color: #102942;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.md-verified-icon {
    color: #0d6efd;
    font-size: 18px;
}
.md-biz-category {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 8px;
}
.md-biz-location {
    font-size: 13px;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #eef2f6;
}

/* Section Box Styling */
.md-section-block {
    padding: 20px 24px;
    border-top: 1px solid #f1f4f8;
}
.md-section-title {
    font-size: 16.5px;
    font-weight: 700;
    color: #102942;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.md-view-all-link {
    font-size: 13px;
    color: #0d6efd;
    text-decoration: none;
    font-weight: 600;
}
.md-view-all-link:hover {
    text-decoration: underline;
}

/* About Us Section */
.md-about-text {
    font-size: 14px;
    color: #475569;
    line-height: 1.65;
    margin: 0;
    white-space: pre-line;
}

/* Products & Services Carousel / Horizontal Scroll */
.md-items-scroll-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
}
.md-item-card {
    min-width: 140px;
    max-width: 155px;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #eef2f6;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}
.md-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    color: inherit;
}
.md-item-thumb-box {
    width: 100%;
    height: 120px;
    background-color: #f1f5f9;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.md-item-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.md-item-card:hover .md-item-thumb {
    transform: scale(1.05);
}
.md-item-tag {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}
.tag-product {
    background: rgba(7, 131, 70, 0.9);
    color: #ffffff;
}
.tag-service {
    background: rgba(13, 110, 253, 0.9);
    color: #ffffff;
}
.md-item-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.md-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #102942;
    margin: 0 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}
.md-item-price {
    font-size: 13px;
    font-weight: 700;
    color: #078346;
    margin-top: auto;
}
.md-item-enquire-cta {
    margin-top: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}
.md-item-card:hover .md-item-enquire-cta {
    color: #078346;
}
.md-item-buy-cta {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #078346;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    width: fit-content;
}
.md-item-card:hover .md-item-buy-cta {
    background: #078346;
    color: #ffffff;
    border-color: #078346;
}

/* Filter Pills for Products / Services */
.md-filter-pill-btn {
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.md-filter-pill-btn.active, .md-filter-pill-btn:hover {
    background: #102942;
    color: #ffffff;
    border-color: #102942;
}

/* Social Media Links Section */
.md-social-grid {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    padding: 4px 0 10px;
}
.md-social-btn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #475569;
    font-size: 11.5px;
    font-weight: 600;
    transition: transform 0.15s ease;
    min-width: 58px;
}
.md-social-btn-wrap:hover {
    transform: translateY(-3px);
    color: #102942;
}
.md-social-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.md-social-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.icon-facebook { background-color: #1877f2; }
.icon-instagram { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.icon-whatsapp { background-color: #25d366; }
.icon-youtube { background-color: #ff0000; }
.icon-website { background-color: #0284c7; }
.icon-twitter { background-color: #000000; }
.icon-linkedin { background-color: #0a66c2; }
.icon-phone { background-color: #078346; }

/* Contact Us Button */
.md-bottom-action-wrap {
    padding: 16px 24px 24px;
}
.btn-contact-main {
    background: #0d6efd;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    padding: 14px 20px;
    border-radius: 12px;
    width: 100%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 18px rgba(13, 110, 253, 0.28);
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}
.btn-contact-main:hover {
    background: #0b5ed7;
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(13, 110, 253, 0.36);
    transform: translateY(-1px);
}

/* Contact Info List */
.md-contact-info-list {
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 14px;
}
.md-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    color: #334155;
    margin-bottom: 8px;
}
.md-contact-item:last-child {
    margin-bottom: 0;
}
.md-contact-item i {
    font-size: 16px;
    color: #078346;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Related Merchants Grid */
.md-related-wrap {
    max-width: 820px;
    margin: 30px auto 0;
}

@media (max-width: 576px) {
    .md-profile-shell {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .md-banner-wrap {
        height: 150px;
    }
    .md-logo-wrap {
        width: 80px;
        height: 80px;
        margin-top: -40px;
        border-radius: 16px;
    }
    .md-biz-name {
        font-size: 19px;
    }
    .md-header-content {
        padding: 0 16px 16px;
    }
    .md-section-block {
        padding: 16px;
    }
    .md-bottom-action-wrap {
        padding: 12px 16px 20px;
    }
}

/* =============================================================
   3. MERCHANT ENQUIRY MODAL STYLES
   ============================================================= */
#merchantEnquiryModal .modal-content {
    border-radius: 20px;
    border: none;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}
#merchantEnquiryModal .modal-header {
    background-color: #102942;
    color: #ffffff;
    padding: 16px 24px;
    border-bottom: none;
}
#merchantOrderModal .modal-header {
    background-color: #102942;
    color: #ffffff;
    padding: 16px 24px;
    border-bottom: none;
}
#merchantEnquiryModal .modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}
#merchantEnquiryModal .btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.8;
}
#merchantEnquiryModal .btn-close-white:hover {
    opacity: 1;
}
#merchantEnquiryModal .form-control {
    font-size: 13.5px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
}
#merchantEnquiryModal .form-control:focus {
    border-color: #078346;
    box-shadow: 0 0 0 0.2rem rgba(7, 131, 70, 0.15);
}
#merchantEnquiryModal .input-group-text {
    border-radius: 8px 0 0 8px;
    border: 1px solid #e2e8f0;
    font-size: 14px;
}
.enquiry-preview-box {
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
