/* Explain: Styles for the merchant store preview iframe, storefront mock, and mobile view. */
/* Merchant store preview */
.mch-preview-frame {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 60px -40px rgba(13, 27, 36, 0.5);
}
.mch-preview-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    background: var(--dark-color);
    color: #fff;
}
.mch-preview-dots {
    display: inline-flex;
    gap: 0.3rem;
    flex-shrink: 0;
}
.mch-preview-dots i {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}
.mch-preview-dots i:nth-child(1) { background: #f87171; }
.mch-preview-dots i:nth-child(2) { background: #fbbf24; }
.mch-preview-dots i:nth-child(3) { background: #34d399; }
.mch-preview-url {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.82);
}
.mch-preview-live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}
.mch-preview-live i {
    font-size: 0.5rem;
    color: #34d399;
}

/* Desktop / mobile view switch */
.mch-preview-views {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
    padding: 0.15rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
}
.mch-preview-view {
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}
.mch-preview-view:hover {
    color: #fff;
}
.mch-preview-view.active {
    background: var(--primary-color);
    color: #fff;
}
.mch-preview-body {
    background: var(--background-color);
    min-height: 20rem;
    transition: max-width 0.3s ease, padding 0.3s ease, background 0.3s ease;
}
.mch-preview-body.is-mobile {
    max-width: 23rem;
    margin-inline: auto;
    padding: 0.9rem;
    background: var(--surface-color);
    border-inline: 1px solid var(--border-color);
}

/* Storefront mock */
.sp-store {
    font-family: var(--font-body);
}
.sp-cover {
    position: relative;
    height: 8rem;
    background: linear-gradient(135deg, var(--store-accent, #00b96b), var(--dark-color));
    background-size: cover;
    background-position: center;
}
@media (min-width: 768px) {
    .sp-cover { height: 11rem; }
}
.sp-cover-tag {
    position: absolute;
    top: 0.75rem;
    inset-inline-end: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: rgba(13, 27, 36, 0.55);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}
.sp-head {
    display: flex;
    align-items: flex-end;
    gap: 0.85rem;
    padding: 0 1rem;
    margin-top: -2rem;
    position: relative;
}
.sp-logo {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    flex-shrink: 0;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid var(--border-color);
    overflow: hidden;
    color: var(--store-accent, #00b96b);
    font-size: 1.5rem;
    box-shadow: 0 12px 30px -18px rgba(13, 27, 36, 0.6);
}
.sp-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.sp-head-info {
    flex: 1;
    min-width: 0;
    padding-bottom: 0.15rem;
}
.sp-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-color);
    overflow-wrap: anywhere;
}
.sp-meta {
    font-size: 0.83rem;
    color: var(--text-muted);
}
.sp-cart {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
    border-radius: 0.8rem;
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}
.sp-body {
    padding: 1rem 1rem 1.5rem;
}
.sp-desc {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.9;
    margin-top: 0.85rem;
}
.sp-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.9rem;
}
.sp-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-color);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}
.sp-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.sp-chip {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--store-accent, #00b96b);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
}
.sp-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 0.9rem;
}
.sp-section-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* Product listings */
.sp-products {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
    .sp-products-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .sp-products-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sp-products-list {
    grid-template-columns: 1fr;
}
.sp-products-masonry {
    display: block;
    columns: 2;
    column-gap: 0.9rem;
}
@media (min-width: 768px) {
    .sp-products-masonry { columns: 3; }
}
.sp-products-masonry .sp-card {
    break-inside: avoid;
    margin-bottom: 0.9rem;
    display: block;
}

.sp-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
}
.sp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 36px -30px rgba(13, 27, 36, 0.5);
    border-color: var(--store-accent, #00b96b);
}
.sp-card-media {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--surface-color);
    overflow: hidden;
}
.sp-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sp-card-list {
    flex-direction: row;
}
.sp-card-list .sp-card-media {
    width: 7rem;
    height: 7rem;
    aspect-ratio: auto;
    flex-shrink: 0;
}
.sp-card-list .sp-card-body {
    justify-content: center;
}
.sp-card-badges {
    position: absolute;
    top: 0.5rem;
    inset-inline-start: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
}
.sp-card-body {
    padding: 0.7rem 0.8rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}
.sp-card-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-color);
    overflow-wrap: anywhere;
}
.sp-card-price {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin-top: auto;
}
.sp-price {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--store-accent, #00b96b);
}
.sp-price-old {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: line-through;
}
.sp-unit {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.sp-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}
.sp-badge-ok {
    background: var(--store-accent, #00b96b);
    color: #fff;
}
.sp-badge-low {
    background: #fef3c7;
    color: #92400e;
}
.sp-badge-off {
    background: #fee2e2;
    color: #b91c1c;
}
.sp-feat {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: var(--dark-color);
    color: #fff;
}
.sp-noimg {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--border-color);
    font-size: 1.8rem;
}
.sp-empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    border-radius: 1rem;
}
.sp-empty-badge {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto 1rem;
    border-radius: 1.1rem;
    background: var(--primary-soft);
    color: var(--primary-color);
    font-size: 1.6rem;
}
.sp-empty-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-color);
}
.sp-empty-text {
    margin-top: 0.5rem;
    max-width: 26rem;
    margin-inline: auto;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-muted);
}
.sp-empty .mk-btn {
    margin-top: 1.1rem;
}

/* Announcement bar */
.sp-announce {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 0.9rem;
    background: var(--store-accent, #00b96b);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.6;
    overflow-wrap: anywhere;
}
.sp-announce i {
    flex-shrink: 0;
}

/* Mobile: keep the mock looking like a real storefront */
@media (max-width: 639px) {
    .sp-head {
        gap: 0.65rem;
    }
    .sp-logo {
        width: 3.3rem;
        height: 3.3rem;
        font-size: 1.25rem;
    }
    .sp-name {
        font-size: 1.1rem;
    }
    .sp-body {
        padding: 0.9rem 0.85rem 1.25rem;
    }
    .sp-announce {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
    .sp-products {
        gap: 0.65rem;
    }
    .sp-card-body {
        padding: 0.6rem 0.65rem 0.7rem;
    }
    .sp-card-name {
        font-size: 0.9rem;
    }
}