/*
Theme Name: MyProdukViral Affiliate
Theme URI: https://myprodukviral.com
Author: MyProdukViral
Description: Custom mobile-first Shopee Collection style affiliate WordPress theme for myprodukviral.com.
Version: 1.0.8
Text Domain: myprodukviral
*/

:root {
    --primary-color: #ee4d2d;
    --bg-gray: #f5f5f5;
    --text-dark: #222222;
    --text-muted: #757575;
    --border-color: #efefef;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #e9ecef;
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* Mobile Container App-Like Shell */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    background-color: var(--bg-gray);
    min-height: 100vh;
    position: relative;
    padding-bottom: 70px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}

/* Header Banner (Shopee Collection Style) */
.store-header {
    position: relative;
    background: linear-gradient(135deg, #2b4c65 0%, #4b738f 50%, #243b4d 100%);
    background-size: cover;
    background-position: center;
    padding: 18px 15px 22px;
    color: #ffffff;
    overflow: hidden;
}

.store-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(20, 35, 48, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
}

.header-inner {
    position: relative;
    z-index: 2;
}

.header-top-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}

.share-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.profile-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background-color: #fff;
    flex-shrink: 0;
}

.profile-info h1 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.2px;
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.22);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.profile-subtitle {
    font-size: 11.5px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 12px;
    font-weight: 500;
}

/* Search Box + Search Button + Clear Button Row */
.search-box-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-input-container {
    position: relative;
    flex: 1;
    min-width: 0;
}

.search-input {
    width: 100%;
    height: 38px;
    border-radius: 6px;
    border: none;
    padding: 0 10px 0 34px;
    font-size: 13px;
    background-color: #ffffff;
    color: var(--text-dark);
    outline: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
    color: #9e9e9e;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9e9e9e;
    width: 15px;
    height: 15px;
    pointer-events: none;
}

.submit-search-btn {
    height: 38px;
    padding: 0 12px;
    border-radius: 6px;
    border: none;
    background-color: #ee4d2d;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: background-color 0.15s ease;
}

.submit-search-btn:active {
    background-color: #d73211;
}

.clear-search-btn {
    height: 38px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: background-color 0.15s ease;
}

.clear-search-btn:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Main Tabs (Products / Categories) */
.main-tabs {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    margin-top: -10px;
    position: relative;
    z-index: 3;
}

.tab-item {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-dark);
    text-decoration: none;
    position: relative;
    cursor: pointer;
    border: none;
    background: transparent;
}

.tab-item.active {
    color: var(--primary-color);
}

.tab-item.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background-color: var(--primary-color);
}

/* Sub Filter Bar */
.sub-filter-bar {
    display: flex;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 9px 0;
    font-size: 12px;
    color: var(--text-muted);
    position: sticky;
    top: 0;
    z-index: 10;
}

.filter-opt {
    flex: 1;
    text-align: center;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    font-weight: 500;
}

.filter-opt:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background-color: #e5e5e5;
}

.filter-opt.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Category Pills Drawer */
.category-panel {
    display: none;
    background: #fff;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 8px;
}

.category-panel.open {
    display: flex;
}

.cat-pill {
    padding: 6px 12px;
    border-radius: 16px;
    background: #f5f5f5;
    color: var(--text-dark);
    font-size: 12px;
    text-decoration: none;
    border: 1px solid #e0e0e0;
}

.cat-pill.active, .cat-pill:hover {
    background: #fff0ed;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 2-Column Product Grid (2 x 25 = 50 items per page) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
}

.product-card {
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease;
    position: relative;
}

.product-card:active {
    transform: scale(0.98);
}

.product-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Square Aspect Ratio */
    background-color: #fafafa;
    overflow: hidden;
}

.product-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.item-number-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    z-index: 2;
}

/* Pagination */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px 10px 24px;
}

.pagination-wrap a,
.pagination-wrap span {
    padding: 6px 12px;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text-dark);
    text-decoration: none;
    border: 1px solid #e0e0e0;
}

.pagination-wrap .current {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    font-weight: 600;
}

/* Article List & Single Article */
.article-section {
    padding: 12px;
}

.article-card {
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: block;
    text-decoration: none;
    color: inherit;
}

.article-card-thumb {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.article-card h2 {
    font-size: 15px;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.article-card p {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.article-meta {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
}

.single-article-box {
    background: #fff;
    margin: 10px;
    padding: 18px 16px;
    border-radius: 8px;
    line-height: 1.75;
    font-size: 14.5px;
    color: #2b2b2b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.single-article-box > h1 {
    font-size: 20px;
    line-height: 1.35;
    margin-bottom: 10px;
    color: #111;
}

.single-article-box > img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 10px 0 16px;
    display: block;
}

/* Proper Rich-Text Spacing Inside Article Content */
.article-content p {
    margin-bottom: 16px;
    line-height: 1.75;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    line-height: 1.35;
    font-weight: 700;
    color: #111111;
}

.article-content h2 {
    font-size: 18px;
}

.article-content h3 {
    font-size: 16px;
}

.article-content h4 {
    font-size: 15px;
}

.article-content ul,
.article-content ol {
    margin: 0 0 16px 20px;
    padding-left: 4px;
}

.article-content li {
    margin-bottom: 8px;
    line-height: 1.65;
}

.article-content hr {
    border: 0;
    border-top: 1px solid #e5e5e5;
    margin: 22px 0;
}

.article-content blockquote {
    border-left: 3px solid var(--primary-color);
    background: #fff8f6;
    padding: 12px 14px;
    margin: 16px 0;
    border-radius: 0 6px 6px 0;
    color: #444;
}

.article-content img,
.article-content figure {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

/* Fixed Bottom Footer Navigation */
.bottom-footer-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 58px;
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
}

.footer-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    gap: 3px;
    height: 100%;
}

.footer-nav-item.active {
    color: var(--primary-color);
}

.footer-nav-item svg {
    width: 20px;
    height: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Title Below Product Image */
.product-card {
    display: flex;
    flex-direction: column;
}

.product-card-body {
    padding: 8px 8px 9px;
    background: #ffffff;
    flex: 1;
    display: flex;
    align-items: center;
}

.product-card-title {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
