/*
 * Public store: product list (index.php) + product page (product.php).
 * The theme sets html{font-size:10px} (Bootstrap 3), so sizes here are px.
 */
/* Tokens: shared by the page section, the mobile buy bar (outside .store) and the cart modal. */
.store, .st-sticky, #cart {
    --st-accent: #ef5b2b;
    --st-accent-dark: #d94a1c;
    --st-ink: #1a202c;
    --st-ink-2: #2d3748;
    --st-ink-3: #4a5568;
    --st-line: #e5e9f0;
    --st-bg: #f0f3f7;
    --st-green: #1f8a4c;
}
.store {
    background: var(--st-bg);
    padding: 36px 0 56px;
    font-family: 'Nunito Sans', 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--st-ink);
}
.store * { box-sizing: border-box; }
.store .container { max-width: 1180px; width: 100%; padding-left: 16px; padding-right: 16px; }
.store .alert-area { max-width: 760px; margin: 0 auto 16px; }

/* ---------- Section title ---------- */
.st-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.st-head h1 { font-size: 28px; font-weight: 800; margin: 0; color: var(--st-ink); letter-spacing: -0.3px; }
.st-head span { font-size: 14px; color: var(--st-ink-3); font-weight: 600; }

/* ---------- Product grid ---------- */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.st-grid > form { margin: 0; display: flex; }
.st-card {
    background: #fff; border: 1px solid #cfd7e2; border-radius: 14px; overflow: hidden;
    display: flex; flex-direction: column; width: 100%; box-shadow: 0 1px 3px rgba(26, 32, 44, .06);
    transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.st-card:hover { box-shadow: 0 12px 28px rgba(26, 32, 44, .12); transform: translateY(-3px); border-color: #aab6c6; }
.st-media { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: linear-gradient(180deg, #e3e9f1 0%, #d9e0ea 100%); padding: 14px; border-bottom: 1px solid #cfd7e2; }
.st-media img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; border-radius: 6px; box-shadow: 0 4px 14px rgba(26, 32, 44, .18); }
.st-tag {
    position: absolute; top: 12px; left: 12px; background: rgba(26, 32, 44, .85); color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 5px 10px; border-radius: 6px;
}
.st-tag.is-free { background: var(--st-green); }
.st-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.st-name { font-size: 18px; line-height: 1.35; font-weight: 800; margin: 0 0 8px; }
.st-name a { color: var(--st-ink); text-decoration: none; }
.st-name a:hover { color: var(--st-accent); text-decoration: none; }
.st-desc {
    font-size: 14px; line-height: 1.6; color: var(--st-ink-2); margin: 0 0 16px;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.st-foot { margin-top: auto; }
.st-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 14px; }
.st-price b { font-size: 24px; font-weight: 800; color: var(--st-ink); }
.st-price small { font-size: 13px; color: var(--st-ink-3); font-weight: 600; }
.st-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.st-actions .st-btn { flex: 1 0 auto; white-space: nowrap; }

/* ---------- Buttons ---------- */
.st-btn {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 16px; border-radius: 10px; border: 1.5px solid transparent;
    font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.st-btn:hover, .st-btn:focus { text-decoration: none; }
.st-btn-primary { background: var(--st-accent); color: #fff; box-shadow: 0 4px 12px rgba(239, 91, 43, .25); }
.st-btn-primary:hover, .st-btn-primary:focus { background: var(--st-accent-dark); color: #fff; }
.st-btn-ghost { background: #fff; color: var(--st-ink); border-color: #cfd6e1; }
.st-btn-ghost:hover, .st-btn-ghost:focus { border-color: var(--st-ink); color: var(--st-ink); }
.st-btn[disabled] { opacity: .7; cursor: wait; }
.st-btn-lg { min-height: 52px; font-size: 16px; border-radius: 12px; }

/* ---------- Product page ---------- */
.st-crumb { font-size: 13px; color: var(--st-ink-3); margin-bottom: 18px; font-weight: 600; }
.st-crumb a { color: var(--st-ink-3); text-decoration: none; }
.st-crumb a:hover { color: var(--st-accent); }
.st-crumb i { margin: 0 6px; font-size: 10px; }
.st-hero {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start;
    background: #fff; border: 1px solid #cfd7e2; border-radius: 16px; padding: 24px; box-shadow: 0 1px 3px rgba(26, 32, 44, .06);
}
.st-hero-media { display: block; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #e3e9f1 0%, #d9e0ea 100%); border: 1px solid #cfd7e2; padding: 14px; }
.st-hero-media img { border-radius: 6px; box-shadow: 0 4px 14px rgba(26, 32, 44, .18); }
.st-hero-media img { width: 100%; height: auto; display: block; }
.st-hero-info h1 { font-size: 28px; line-height: 1.25; font-weight: 800; margin: 4px 0 12px; color: var(--st-ink); letter-spacing: -0.3px; }
.st-hero-info .st-tag { position: static; display: inline-block; }
.st-lead { font-size: 15px; line-height: 1.65; color: var(--st-ink-2); margin: 0 0 20px; }
.st-lead p { margin: 0 0 8px; }
.st-buybox { border: 1px solid var(--st-line); background: #fafbfc; border-radius: 12px; padding: 18px; }
.st-buybox .st-price { margin-bottom: 14px; }
.st-buybox .st-price b { font-size: 34px; }
.st-buybox form { margin: 0; display: flex; }
.st-help { margin-top: 12px; font-size: 13px; color: var(--st-ink-3); font-weight: 600; text-align: center; }
.st-help a { color: var(--st-green); text-decoration: none; }
.st-help a:hover { text-decoration: underline; }

.st-details { margin-top: 24px; background: #fff; border: 1px solid #cfd7e2; box-shadow: 0 1px 3px rgba(26, 32, 44, .06); border-radius: 16px; padding: 28px; }
.st-details > h2 { font-size: 20px; font-weight: 800; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--st-line); color: var(--st-ink); }
.st-content { font-size: 15px; line-height: 1.7; color: var(--st-ink-2); overflow-wrap: anywhere; }
.st-content img, .st-content video, .st-content iframe { max-width: 100%; height: auto; border-radius: 10px; }
.st-content table { display: block; max-width: 100%; overflow-x: auto; }
.st-content pre { max-width: 100%; overflow-x: auto; }
.st-content h1, .st-content h2, .st-content h3, .st-content h4 { color: var(--st-ink); }
.st-details-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--st-line); }
.st-details-cta .st-price { margin: 0; }
.st-details-cta form { margin: 0; display: flex; min-width: 220px; }

/* Mobile sticky buy bar */
.st-sticky { display: none; }

@media (max-width: 991px) {
    .st-hero { grid-template-columns: 1fr; gap: 20px; padding: 16px; }
}
@media (max-width: 767px) {
    .store { padding: 20px 0 32px; }
    .st-head h1 { font-size: 22px; }
    .st-grid { grid-template-columns: 1fr; gap: 16px; }
    .st-hero-info h1 { font-size: 22px; }
    .st-buybox .st-price b { font-size: 28px; }
    .st-details { padding: 18px 16px; border-radius: 12px; }
    .st-details-cta { display: none; }
    .st-sticky {
        display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
        background: #fff; border-top: 1px solid var(--st-line); box-shadow: 0 -6px 18px rgba(26, 32, 44, .08);
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    }
    .st-sticky .st-price { margin: 0; flex-direction: column; gap: 0; }
    .st-sticky .st-price b { font-size: 20px; }
    .st-sticky form { margin: 0; flex: 1; display: flex; }
}

/* ---------- Cart modal (#cart lives in header.php; this file only loads on store pages) ---------- */
#cart .modal-dialog { max-width: 560px; width: auto; margin: 60px auto; padding: 0 16px; }
#cart .modal-content { border: 0; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 60px rgba(26, 32, 44, .25); font-family: 'Nunito Sans', 'Segoe UI', Roboto, Arial, sans-serif; }
#cart .modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid #e5e9f0; }
#cart .modal-header:before, #cart .modal-header:after { display: none; }
#cart .modal-title { font-size: 19px; font-weight: 800; color: #1a202c; margin: 0; display: flex; align-items: center; gap: 8px; }
#cart .stc-count { background: #ef5b2b; color: #fff; font-size: 12px; font-weight: 700; border-radius: 20px; padding: 2px 9px; }
#cart .modal-header .close { order: 2; margin: 0; opacity: .6; font-size: 28px; line-height: 1; color: #1a202c; text-shadow: none; }
#cart .modal-header .close:hover { opacity: 1; }
#cart .modal-body { padding: 6px 22px; max-height: 55vh; overflow-y: auto; }
#cart .show-cart { width: 100%; margin: 0; border: 0; }
#cart .show-cart tr { border-bottom: 1px solid #edf1f6 !important; }
#cart .show-cart tr:last-child { border-bottom: 0 !important; }
#cart .show-cart td { padding: 14px 6px !important; border: 0; vertical-align: middle; }
#cart .stc-thumb { width: 72px; }
#cart .stc-thumb img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid #e5e9f0; display: block; }
#cart .stc-name { font-size: 15px; font-weight: 700; color: #1a202c; line-height: 1.4; }
#cart .stc-price { font-size: 16px; font-weight: 800; color: #1a202c; text-align: right; white-space: nowrap; }
#cart .stc-remove { width: 44px; text-align: right; }
#cart .delete-item { width: 36px; height: 36px; border-radius: 10px; border: 1px solid #e5e9f0; background: #fff; color: #c53030; font-size: 15px; cursor: pointer; padding: 0; }
#cart .delete-item:hover { background: #fff5f5; border-color: #feb2b2; }
#cart .delete-item.removing img { width: 18px !important; }
#cart .stc-empty td { text-align: center; padding: 36px 0 !important; }
#cart .stc-empty i { display: block; font-size: 36px; color: #cbd5e0; margin-bottom: 10px; }
#cart .stc-empty b { display: block; font-size: 16px; color: #1a202c; margin-bottom: 16px; }
#cart .stc-empty .st-btn { flex: none; display: inline-flex; }
#cart .modal-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 22px 20px; border-top: 1px solid #e5e9f0; background: #fafbfc; }
#cart .modal-footer:before, #cart .modal-footer:after { display: none; }
#cart .stc-total { flex: 1 1 100%; display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
#cart .stc-total span { font-size: 15px; font-weight: 700; color: #2d3748; }
#cart .stc-total b { font-size: 26px; font-weight: 800; color: #1a202c; }
#cart .modal-footer .btn { flex: 1; margin: 0 !important; min-height: 46px; border-radius: 10px; font-size: 15px; font-weight: 700; }
#cart .modal-footer .btn-secondary { background: #fff; border: 1.5px solid #cfd6e1; color: #1a202c; }
#cart .modal-footer .btn-secondary:hover { border-color: #1a202c; }
#cart .modal-footer .btn-primary { background: #ef5b2b; border: 0; color: #fff; box-shadow: 0 4px 12px rgba(239, 91, 43, .25); }
#cart .modal-footer .btn-primary:hover { background: #d94a1c; }
#cart .modal-footer .btn-primary[disabled] { opacity: .5; }
@media (max-width: 480px) {
    #cart .modal-dialog { margin: 20px auto; }
    #cart .modal-footer { flex-direction: column-reverse; align-items: stretch; }
    #cart .stc-total { order: 3; }
    #cart .modal-footer .btn { width: 100%; }
}

/* ---------- Product description components (used inside .st-content) ----------
 * Descriptions are plain HTML using only these classes: no inline styles,
 * no <style> blocks. Icons are Font Awesome 4 (fa fa-*).
 */
.st-content > :first-child { margin-top: 0; }
.st-content p { margin: 0 0 12px; }
.st-content a { color: var(--st-accent); font-weight: 600; }
.st-content b, .st-content strong { color: var(--st-ink); }
.pd-lead { font-size: 16px; line-height: 1.7; color: var(--st-ink-2); margin: 0 0 8px; }
.pd-section { margin-top: 32px; }
.pd-section:first-child { margin-top: 0; }
.pd-section > h3 { font-size: 19px; font-weight: 800; color: var(--st-ink); margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.pd-section > h3 > .fa { width: 32px; height: 32px; border-radius: 8px; background: #fff1eb; color: var(--st-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }

.pd-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pd-feature { display: flex; gap: 12px; align-items: flex-start; border: 1px solid #dfe5ed; border-radius: 12px; padding: 14px; background: #fbfcfd; }
.pd-feature > .fa { width: 36px; height: 36px; border-radius: 9px; background: #fff1eb; color: var(--st-accent); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.pd-feature h4 { font-size: 15px; font-weight: 800; color: var(--st-ink); margin: 2px 0 4px; }
.pd-feature p { font-size: 14px; line-height: 1.55; color: var(--st-ink-2); margin: 0; }

.pd-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; }
.pd-list.pd-one { grid-template-columns: 1fr; }
.pd-list li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.55; color: var(--st-ink-2); }
.pd-list li:before { content: "\f00c"; font-family: FontAwesome; position: absolute; left: 0; top: 1px; color: var(--st-green); font-size: 14px; }

.pd-steps { list-style: none; counter-reset: pdstep; margin: 0; padding: 0; display: grid; gap: 10px; }
.pd-steps li { counter-increment: pdstep; position: relative; padding: 12px 14px 12px 54px; border: 1px solid #dfe5ed; border-radius: 12px; background: #fbfcfd; font-size: 15px; line-height: 1.55; color: var(--st-ink-2); }
.pd-steps li:before { content: counter(pdstep); position: absolute; left: 14px; top: 11px; width: 28px; height: 28px; border-radius: 50%; background: var(--st-accent); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.pd-steps li b:first-child { display: block; color: var(--st-ink); margin-bottom: 2px; }

.pd-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #dfe5ed; border-radius: 12px; }
.st-content .pd-table-wrap table { display: table; }
.pd-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 460px; }
.pd-table th, .pd-table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid #e5e9f0; color: var(--st-ink-2); }
.pd-table th { background: #f3f6f9; color: var(--st-ink); font-weight: 800; white-space: nowrap; }
.pd-table tr:last-child td { border-bottom: 0; }

.pd-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.pd-spec { border: 1px solid #dfe5ed; border-radius: 12px; padding: 12px 14px; background: #fbfcfd; }
.pd-spec span { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--st-ink-3); margin-bottom: 3px; }
.pd-spec b { font-size: 15px; color: var(--st-ink); }

.pd-note, .pd-warn { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 14px 16px; font-size: 14.5px; line-height: 1.6; margin: 14px 0 0; }
.pd-note { background: #eef6ff; border: 1px solid #c3dcf5; color: #1e3a5f; }
.pd-warn { background: #fff8eb; border: 1px solid #f5d9a8; color: #5f3b0a; }
.pd-note > .fa, .pd-warn > .fa { font-size: 17px; margin-top: 2px; flex-shrink: 0; }
.pd-note > div, .pd-warn > div { flex: 1; min-width: 0; }

.pd-code { background: #1a202c; color: #e2e8f0; border-radius: 10px; padding: 12px 14px; font-family: Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; overflow-x: auto; white-space: pre; margin: 8px 0 0; }

.pd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pd-gallery a { display: block; border: 1px solid #dfe5ed; border-radius: 10px; overflow: hidden; background: linear-gradient(180deg, #e3e9f1 0%, #d9e0ea 100%); padding: 8px; }
.pd-gallery img { width: 100%; height: auto; display: block; border-radius: 6px; }
.st-content .pd-media { display: block; margin: 0 auto; border: 1px solid #dfe5ed; border-radius: 12px; }

.pd-faq details { border: 1px solid #dfe5ed; border-radius: 12px; background: #fbfcfd; margin-bottom: 8px; }
.pd-faq summary { cursor: pointer; padding: 13px 16px; font-size: 15px; font-weight: 800; color: var(--st-ink); list-style: none; }
.pd-faq summary::-webkit-details-marker { display: none; }
.pd-faq summary:after { content: "\f107"; font-family: FontAwesome; float: right; color: var(--st-ink-3); }
.pd-faq details[open] summary:after { content: "\f106"; }
.pd-faq details > div { padding: 0 16px 14px; font-size: 14.5px; line-height: 1.6; color: var(--st-ink-2); }

@media (max-width: 767px) {
    .pd-features, .pd-list { grid-template-columns: 1fr; }
    .pd-section { margin-top: 26px; }
    .pd-section > h3 { font-size: 17px; }
}
