/* KiduMall Directory Plugin - Modern 2027 Native Styles */
.km-root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #f8fafc;
    background-color: #020617;
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 1300px;
    margin: 20px auto;
    box-sizing: border-box;
}

.km-root * {
    box-sizing: border-box;
}

/* Header & Controls */
.km-header-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

.km-header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.km-brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
}

.km-logo-badge {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    font-weight: 900;
    font-size: 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
}

.km-app-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.km-app-subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.km-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.km-input-select {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 9px 14px;
    border-radius: 12px;
    font-size: 13px;
    outline: none;
}

/* Buttons */
.km-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
}

.km-btn-primary {
    background: #f97316;
    color: #ffffff !important;
}

.km-btn-primary:hover {
    background: #fb923c;
    transform: translateY(-1px);
}

.km-btn-outline {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0 !important;
}

.km-btn-outline:hover {
    background: rgba(255, 255, 255, 0.12);
}

.km-btn-whatsapp {
    background: #10b981;
    color: #ffffff !important;
}

/* Navigation Tabs */
.km-nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 18px;
}

.km-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.km-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.km-tab-btn.active {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.3);
    color: #f97316;
}

/* Search & Categories */
.km-search-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.km-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 10px 16px;
    color: #94a3b8;
}

.km-search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14px;
    width: 100%;
}

.km-badge-count {
    background: #1e293b;
    color: #f97316;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    white-space: nowrap;
}

.km-categories-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.km-category-pill {
    background: #1e293b;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.km-category-pill:hover,
.km-category-pill.active {
    background: #f97316;
    color: #ffffff;
    border-color: #f97316;
}

/* Tab Panels */
.km-tab-panel {
    display: none;
}

.km-tab-panel.active {
    display: block;
}

/* Grid & Cards */
.km-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.km-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.km-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
    border-color: rgba(249, 115, 22, 0.3);
}

.km-card-image-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background: #1e293b;
}

.km-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.km-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
}

.km-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.km-badge-cat {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.km-badge-featured {
    background: #f97316;
    color: #ffffff;
}

.km-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.km-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.km-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
}

.km-card-tagline {
    font-size: 13px;
    color: #94a3b8;
    margin: 0 0 14px 0;
    line-height: 1.5;
    flex-grow: 1;
}

.km-card-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
}

.km-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #cbd5e1;
}

.km-card-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.km-action-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #cbd5e1 !important;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.km-action-btn:hover {
    background: #334155;
    color: #ffffff !important;
}

.km-action-whatsapp:hover {
    background: #10b981;
    border-color: #10b981;
}

.km-action-card:hover {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.km-action-inquiry:hover {
    background: #f97316;
    border-color: #f97316;
}

/* Map Container */
.km-map-container {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px;
}

.km-map-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.km-map-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.km-map-desc {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.km-map-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.km-legend-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

.km-pin-tech { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid #3b82f6; }
.km-pin-toys { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid #ec4899; }
.km-pin-fashion { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }
.km-pin-food { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #f59e0b; }

.km-vector-map-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
}

.km-svg-map {
    width: 100%;
    height: auto;
    min-width: 650px;
    display: block;
}

.km-map-drawer {
    margin-top: 18px;
    padding: 16px 20px;
    background: #1e293b;
    border-radius: 14px;
    border: 1px solid rgba(249, 115, 22, 0.3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.km-drawer-title {
    margin: 0 0 4px 0;
    font-size: 16px;
    color: #f97316;
}

.km-drawer-desc {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #cbd5e1;
}

.km-drawer-actions {
    display: flex;
    gap: 10px;
}

/* Digital Visiting Cards */
.km-vcards-header {
    text-align: center;
    margin-bottom: 24px;
}

.km-vcards-header h3 {
    margin: 0;
    font-size: 20px;
}

.km-vcards-header p {
    color: #94a3b8;
    font-size: 13px;
    margin-top: 6px;
}

.km-vcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.km-vcard-container {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 24px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transition: transform 0.2s, border-color 0.2s;
}

.km-vcard-container:hover {
    transform: translateY(-4px);
    border-color: #f97316;
}

.km-vcard-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.km-vcard-chip {
    width: 38px;
    height: 28px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 6px;
}

.km-vcard-badge {
    font-size: 10px;
    text-transform: uppercase;
    color: #f97316;
    letter-spacing: 0.1em;
    font-weight: 800;
}

.km-vcard-name {
    margin: 0 0 4px 0;
    font-size: 18px;
    color: #ffffff;
}

.km-vcard-cat {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 14px 0;
}

.km-vcard-details p {
    margin: 4px 0;
    font-size: 12px;
    color: #cbd5e1;
}

.km-vcard-action-hint {
    display: inline-block;
    margin-top: 14px;
    font-size: 11px;
    font-weight: 700;
    color: #f97316;
}

/* Canva Ad Creator */
.km-adcreator-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: #0f172a;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 850px) {
    .km-adcreator-wrap {
        grid-template-columns: 1fr;
    }
}

.km-form-group {
    margin-bottom: 14px;
}

.km-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.km-form-group input,
.km-form-group select,
.km-form-group textarea {
    width: 100%;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
}

.km-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.km-ad-preview-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

#km-ad-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* AI Studio */
.km-ai-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    background: #0f172a;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 850px) {
    .km-ai-wrap {
        grid-template-columns: 1fr;
    }
}

.km-ai-output {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    min-height: 180px;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

/* Merchant Dashboard */
.km-dashboard-wrap {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.km-dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.km-stat-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
}

.km-stat-title {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 700;
}

.km-stat-number {
    margin: 8px 0;
    font-size: 28px;
    font-weight: 800;
}

.km-stat-badge {
    font-size: 11px;
    color: #94a3b8;
}

.km-stat-badge.positive {
    color: #34d399;
    font-weight: 600;
}

.km-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 16px;
}

.km-plan-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.km-plan-card.popular {
    border-color: #f97316;
    background: #1e1b18;
}

.km-popular-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #f97316;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
}

.km-plan-price {
    font-size: 32px;
    font-weight: 800;
    margin: 10px 0;
    color: #f97316;
}

.km-plan-price span {
    font-size: 13px;
    color: #94a3b8;
}

.km-plan-card ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    font-size: 13px;
    color: #cbd5e1;
    flex-grow: 1;
}

.km-plan-card ul li {
    margin-bottom: 8px;
    padding-left: 18px;
    position: relative;
}

.km-plan-card ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #34d399;
}

/* Modals */
.km-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
}

.km-modal-box {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

.km-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.km-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.km-modal-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
}

.km-modal-body {
    padding: 24px;
}

.km-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.km-modal-card-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.km-modal-vcard-graphic {
    width: 100%;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(249, 115, 22, 0.4);
    border-radius: 16px;
    padding: 20px;
    position: relative;
}

.km-modal-vcard-logo {
    width: 32px;
    height: 32px;
    background: #f97316;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 10px;
}

.km-qr-box {
    text-align: center;
    background: #ffffff;
    padding: 16px;
    border-radius: 14px;
}

.km-qr-label {
    display: block;
    color: #020617;
    font-size: 11px;
    font-weight: 700;
    margin-top: 8px;
}

/* Detail Showcase Modal */
.km-detail-modal-box {
    max-width: 820px !important;
    width: 95% !important;
}

.km-detail-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.km-detail-product-card {
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
}

.km-detail-product-card:hover {
    transform: translateY(-2px);
    border-color: #f97316;
}

.km-detail-prod-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #0f172a;
}

.km-detail-prod-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.km-detail-prod-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.km-detail-prod-price {
    font-size: 15px;
    font-weight: 800;
    color: #f97316;
    margin-bottom: 6px;
}

.km-detail-prod-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
    margin: 0 0 10px 0;
    flex-grow: 1;
}

.km-detail-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.km-detail-gallery-item {
    border-radius: 10px;
    overflow: hidden;
    height: 130px;
    background: #020617;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.km-detail-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.km-detail-gallery-item:hover img {
    transform: scale(1.05);
}

.km-detail-video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 14px;
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.km-detail-video-container iframe,
.km-detail-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.km-detail-map-embed-box {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #020617;
    min-height: 250px;
}

.km-detail-map-embed-box iframe {
    width: 100%;
    height: 280px;
    border: 0;
    display: block;
}
