/* ============================================================
   EJS Downloads — Frontend Store & History Styles
============================================================ */

/* ── Store Wrapper ── */
.ejs-store,
.ejs-history {
    max-width: 1200px;
    width: 95%;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a2e;
}

/* ── Store Header ── */
.ejs-store-header {
    text-align: center;
    padding: 50px 20px 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border-radius: 16px;
    margin-bottom: 36px;
    color: #fff;
}
.ejs-store-logo {
    max-width: 180px;
    max-height: 70px;
    height: auto;
    margin-bottom: 16px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.ejs-store-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px;
    color: #fff;
    letter-spacing: -0.5px;
}
.ejs-store-tagline {
    font-size: 16px;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

/* ── Filter Bar ── */
.ejs-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 30px;
}
.ejs-search-form { flex: 1; min-width: 240px; }
.ejs-search-wrap { display: flex; gap: 0; }
.ejs-search-input {
    flex: 1;
    padding: 11px 16px;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.ejs-search-input:focus { border-color: #6366f1; }
.ejs-search-btn {
    padding: 11px 18px;
    background: #6366f1;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}
.ejs-search-btn:hover { background: #4f46e5; }

.ejs-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.ejs-cat-tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.18s ease;
    border: 2px solid transparent;
}
.ejs-cat-tab:hover { background: #e2e8f0; color: #1e293b; }
.ejs-cat-tab.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

/* ── Product Grid ── */
.ejs-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* ── Product Card ── */
.ejs-product-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}
.ejs-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}
.ejs-product-card.ejs-featured {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}

.ejs-featured-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #6366f1;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}
.ejs-sale-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.ejs-card-image {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
    padding: 16px;
    box-sizing: border-box;
}
.ejs-card-image img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    transition: transform 0.3s ease;
}
.ejs-product-card:hover .ejs-card-image img { transform: scale(1.04); }
.ejs-card-image-placeholder {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #cbd5e1;
}

.ejs-card-body {
    padding: 20px;
    flex: 1;
}
.ejs-card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.ejs-card-category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6366f1;
}
.ejs-card-version {
    font-size: 11px;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.ejs-card-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 8px;
    color: #1a1a2e;
    line-height: 1.35;
}
.ejs-card-desc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px;
    line-height: 1.6;
}
.ejs-card-compat {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.ejs-compat-tag {
    font-size: 11px;
    background: #ecfdf5;
    color: #059669;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.ejs-woo-tag {
    background: #fdf4ff;
    color: #9333ea;
}
.ejs-card-filesize {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.ejs-card-footer {
    padding: 16px 20px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ejs-card-price { display: flex; align-items: baseline; gap: 8px; }
.ejs-price { font-size: 22px; font-weight: 800; color: #1a1a2e; }
.ejs-price-original { font-size: 15px; color: #94a3b8; text-decoration: line-through; }
.ejs-price-sale { font-size: 22px; font-weight: 800; color: #ef4444; }
.ejs-price-free { font-size: 18px; font-weight: 800; color: #10b981; }

/* ── Buttons ── */
.ejs-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.ejs-btn-buy {
    background: #6366f1;
    color: #fff;
}
.ejs-btn-buy:hover { background: #4f46e5; color: #fff; }
.ejs-btn-free {
    background: #10b981;
    color: #fff;
}
.ejs-btn-free:hover { background: #059669; color: #fff; }
.ejs-btn-download {
    background: #1a1a2e;
    color: #fff;
}
.ejs-btn-download:hover { background: #0f3460; color: #fff; }

/* ── No Products ── */
.ejs-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

/* ── Store Footer ── */
.ejs-store-footer {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 14px;
}
.ejs-store-footer a { color: #6366f1; font-weight: 600; text-decoration: none; }
.ejs-store-footer a:hover { text-decoration: underline; }

/* ── History ── */
.ejs-history-header {
    text-align: center;
    padding: 40px 20px 30px;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    border-radius: 16px;
    margin-bottom: 30px;
    color: #fff;
}
.ejs-history-header h2 { color: #fff; margin: 0 0 8px; font-size: 26px; }
.ejs-history-header p { color: rgba(255,255,255,0.7); margin: 0; }

.ejs-history-empty {
    text-align: center;
    padding: 60px 20px;
}
.ejs-history-empty-icon { font-size: 60px; margin-bottom: 16px; }
.ejs-history-empty h3 { font-size: 22px; margin-bottom: 8px; }
.ejs-history-empty p { color: #64748b; margin-bottom: 20px; }

.ejs-history-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 30px; }

.ejs-history-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: box-shadow 0.2s ease;
}
.ejs-history-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.ejs-history-image { flex-shrink: 0; }
.ejs-history-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}
.ejs-history-info { flex: 1; }
.ejs-history-name { font-size: 17px; font-weight: 700; margin: 0 0 8px; }
.ejs-history-meta { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ejs-history-dates { font-size: 12px; color: #94a3b8; display: flex; flex-direction: column; gap: 2px; }
.ejs-history-action { flex-shrink: 0; text-align: center; }
.ejs-filename { font-size: 11px; color: #94a3b8; margin: 6px 0 0; word-break: break-all; }

/* ── Login Required ── */
.ejs-login-required {
    text-align: center;
    padding: 40px;
    background: #f8fafc;
    border-radius: 12px;
    font-size: 16px;
}
.ejs-login-required a { color: #6366f1; font-weight: 600; }

/* ── Thank You Page Downloads ── */
.ejs-thankyou-downloads {
    background: #fff;
    border: 2px solid #6366f1;
    border-radius: 12px;
    padding: 28px;
    margin: 30px 0;
}
.ejs-thankyou-downloads h2 { margin: 0 0 16px; font-size: 20px; }
.ejs-thankyou-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.ejs-thankyou-item:last-of-type { border-bottom: none; }
.ejs-thankyou-item img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; }
.ejs-thankyou-item-info { flex: 1; }
.ejs-version { font-size: 12px; background: #f1f5f9; padding: 2px 8px; border-radius: 10px; color: #64748b; }
.ejs-login-notice {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}
.ejs-thankyou-note { font-size: 13px; color: #64748b; margin-top: 16px; }

/* ── Responsive ── */
@media (max-width: 640px) {
    .ejs-store-title { font-size: 24px; }
    .ejs-product-grid { grid-template-columns: 1fr; }
    .ejs-filter-bar { flex-direction: column; align-items: stretch; }
    .ejs-history-card { flex-direction: column; text-align: center; }
    .ejs-history-action { width: 100%; }
    .ejs-btn-download { width: 100%; justify-content: center; }
}

/* ============================= */
/* Marketing Opt-in Box          */
/* ============================= */

.ejs-optin-box {
    background: linear-gradient(135deg, #0d1b3e 0%, #1a3a6e 100%);
    border-radius: 12px;
    padding: 32px 36px;
    margin: 32px 0 16px;
    text-align: center;
    color: #fff;
}

.ejs-optin-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.ejs-optin-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 10px;
    color: #fff;
}

.ejs-optin-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    margin: 0 0 20px;
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.ejs-optin-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ejs-optin-input {
    padding: 10px 16px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    min-width: 260px;
    outline: none;
}

.ejs-btn-optin {
    background: #e8b84b !important;
    color: #0d1b3e !important;
    border: none !important;
    padding: 10px 22px !important;
    border-radius: 6px !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    white-space: nowrap;
}

.ejs-btn-optin:hover {
    background: #f0c85a !important;
}

.ejs-optin-privacy {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
    margin: 0;
}

.ejs-optin-success {
    font-size: 16px;
    color: #fff;
    padding: 16px;
}

.ejs-thankyou-downloads {
    padding-bottom: 100px;
}
