/* ── FCommerce Frontend Styles ─────────────────────────────────────────────── */

.fc-wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }

/* ── Shop Banner ── */
.fc-shop-banner { width: calc(100% + 80px); height: 120px; position: relative; overflow: hidden; margin-bottom: 0; margin-left: -40px; margin-right: -40px; }
.fc-shop-banner-img { background-size: cover; background-position: center; }
.fc-shop-banner-gradient { background: linear-gradient(135deg, #667eea 0%, #764ba2 30%, #f093fb 60%, #f5a623 100%); display: flex; align-items: center; justify-content: center; }
.fc-shop-banner-title { color: #fff; font-size: 26px; font-weight: 700; letter-spacing: .5px; text-shadow: 0 2px 8px rgba(0,0,0,.4); }

/* ── Toolbar ── */
.fc-shop-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.fc-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-cat-chips { margin-bottom: 16px; }
.fc-product-grid { margin-top: 16px; }
.fc-chip { padding: 5px 14px; border-radius: 20px; border: 1px solid #ccc; background: #f5f5f5; color: #333; font-size: 13px; text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.fc-chip:hover, .fc-chip-active { background: #111; color: #fff; border-color: #111; }

/* ── Buttons ── */
.fc-btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; font-weight: 500; transition: opacity .15s; }
.fc-btn:hover { opacity: .85; }
.fc-btn-primary { background: #111; color: #fff; }
.fc-btn-secondary { background: #f0f0f0; color: #333; border: 1px solid #ccc; }
.fc-btn-cart { background: #2563eb; color: #fff; font-size: 13px; padding: 6px 12px; }
.fc-btn-cart.fc-in-cart { background: #16a34a; font-size: 12px; padding: 5px 10px; cursor: pointer; width:40%;}
.fc-btn-icon { background: transparent; color: #999; padding: 5px 7px; font-size: 15px; }
.fc-btn-icon:hover { color: #e00; }
.fc-btn-full { width: 100%; justify-content: center; }
.fc-btn-danger { background: #dc2626; color: #fff; }
.fc-btn-paypal { background: #ffc439; color: #003087; font-weight: 700; }

/* ── Product Grid ── */
.fc-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.fc-product-card { border: 1px solid #e5e5e5; border-radius: 10px; overflow: hidden; background: #fff; transition: box-shadow .2s; }
.fc-product-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.fc-card-img-wrap { display: block; position: relative; aspect-ratio: 1; overflow: hidden; background: #f0f0f0; margin-top: 10px; border-radius: 8px; margin-left: 10px; margin-right: 10px; }
.fc-card-img { width: 100%; height: 100% !important; object-fit: cover; display: block; }
.fc-card-img-placeholder { display: flex; align-items: center; justify-content: center; font-size: 40px; color: #ccc; }
.fc-badge-digital { position: absolute; top: 8px; left: 8px; background: #7c3aed; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 12px; }
.fc-badge-author { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 12px; text-decoration: none; z-index: 1; }
.fc-badge-author:hover { background: rgba(0,0,0,.8); }

.fc-card-body { padding: 10px 12px; }
.fc-card-meta-row { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; flex-wrap: wrap; }
.fc-card-author { font-size: 12px; color: #666; text-decoration: none; }
.fc-card-author:hover { color: #111; text-decoration: underline; }
.fc-card-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.fc-card-price { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.fc-card-actions { display: flex; gap: 4px; align-items: center; }
.fc-price-coins { background: #fef3c7; color: #92400e; font-size: 12px; padding: 2px 8px; border-radius: 12px; }
.fc-price-usd { background: #dcfce7; color: #166534; font-size: 12px; padding: 2px 8px; border-radius: 12px; }

/* ── Single Product ── */
.fc-back-link { display: inline-block; margin-bottom: 16px; font-size: 13px; color: #666; text-decoration: none; }
.fc-back-link:hover { color: #111; }

/* Top row: featured image + info */
.fc-product-top { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px; align-items: start; }
@media (max-width: 640px) { .fc-product-top { grid-template-columns: 1fr; } }

.fc-product-info { display: flex; flex-direction: column; gap: 12px; align-self: start; }

.fc-featured-img { width: 100%; height: 250px !important; object-fit: cover; border-radius: 10px; cursor: pointer; display: block; aspect-ratio: unset; }
.fc-no-img { display: flex; align-items: center; justify-content: center; font-size: 48px; color: #ccc; background: #f0f0f0; border-radius: 10px; height: 250px; }
.fc-product-title { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2; }
.fc-product-price-block { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-product-price-block .fc-price-coins,
.fc-product-price-block .fc-price-usd { font-size: 15px; padding: 4px 12px; }
.fc-purchased-badge { color: #16a34a; font-weight: 600; }
.fc-product-img-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; clear: both; width: 100%; }
.fc-strip-img { width: 90px; height: 90px !important; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s, opacity .15s; flex-shrink: 0; }
.fc-strip-img:hover { border-color: #111; opacity: .9; }

/* Description — full width below gallery */
.fc-product-description-wrap { width: 100%; margin-top: 4px; }
.fc-product-description-label { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.fc-product-description { font-size: 14px; line-height: 1.6; color: #444; }

/* ── Lightbox ── */
.fc-lightbox { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.fc-lightbox-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.88); }
.fc-lightbox-img { position: relative; max-width: 90vw; max-height: 88vh; object-fit: contain; border-radius: 6px; z-index: 1; }
.fc-lightbox-close { position: absolute; top: 16px; right: 20px; z-index: 2; background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }
.fc-lightbox-prev, .fc-lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 36px; cursor: pointer; padding: 8px 14px; border-radius: 6px; line-height: 1; }
.fc-lightbox-prev { left: 16px; }
.fc-lightbox-next { right: 16px; }

/* ── Cart ── */
.fc-cart-layout { display: flex; flex-direction: column; gap: 20px; }
.fc-cart-items { display: flex; flex-direction: column; gap: 12px; }
.fc-cart-item { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid #eee; border-radius: 10px; background: #fff; }
.fc-cart-item-img { flex-shrink: 0; width: 150px; height: 150px; }
.fc-cart-item-img img { width: 150px !important; height: 150px !important; object-fit: cover; border-radius: 8px; display: block; }
.fc-cart-item-img-placeholder { width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; font-size: 40px; background: #f0f0f0; border-radius: 8px; color: #ccc; }
.fc-cart-item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fc-cart-item-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-cart-item-type { font-size: 12px; color: #666; }
.fc-cart-item-price { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.fc-cart-remove { flex-shrink: 0; background: none; border: none; color: #999; font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: color .15s; }
.fc-cart-remove:hover { color: #e00; }
.fc-cart-summary { background: #f9f9f9; border-radius: 10px; padding: 16px 20px; }
.fc-summary-box { display: flex; flex-direction: column; gap: 10px; }
.fc-summary-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.fc-summary-row { display: flex; justify-content: space-between; font-size: 14px; }
.fc-balance-row { font-size: 13px; color: #666; }
.fc-ok { color: #16a34a; font-weight: 600; }
.fc-warn { color: #dc2626; font-weight: 600; }
.fc-cart-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.fc-cart-table th, .fc-cart-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; font-size: 14px; }
.fc-cart-table th { background: #f9f9f9; font-weight: 600; }
.fc-cart-img { width: 56px; height: 56px !important; object-fit: cover; border-radius: 6px; }
.fc-cart-summary-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; }
.fc-cart-summary-total { font-weight: 700; font-size: 16px; border-top: 1px solid #ddd; padding-top: 10px; margin-top: 4px; }

/* ── Checkout ── */
.fc-checkout-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
@media (max-width: 700px) { .fc-checkout-layout { grid-template-columns: 1fr; } }
.fc-section-title { font-weight: 700; font-size: 15px; margin-bottom: 12px; }
.fc-checkout-items { display: flex; flex-direction: column; gap: 0; border: 1px solid #e5e5e5; border-radius: 10px; overflow: hidden; }
.fc-co-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #eee; }
.fc-co-item:last-of-type { border-bottom: none; }
.fc-co-img { width: 56px; height: 56px !important; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.fc-co-img-placeholder { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; background: #f0f0f0; border-radius: 6px; font-size: 22px; color: #ccc; flex-shrink: 0; }
.fc-co-info { flex: 1; min-width: 0; }
.fc-co-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-co-type { font-size: 12px; color: #666; margin-top: 2px; }
.fc-co-price { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.fc-co-totals { padding: 12px 14px; border-top: 2px solid #eee; background: #fafafa; }
.fc-co-total-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.fc-co-total-row:last-child { margin-bottom: 0; }
.fc-section-title-wrap { padding: 12px 14px 0; }

/* Payment box */
.fc-payment-box { border: 1px solid #e5e5e5; border-radius: 10px; padding: 18px; position: sticky; top: 20px; }
.fc-pay-total-display { margin-bottom: 16px; }
.fc-pay-total-line { font-size: 18px; font-weight: 700; margin-bottom: 4px; }

/* Payment modal internals */
.fc-pay-modal-totals { background: #f5f5f5; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.fc-pay-modal-total-row { font-size: 14px; margin-bottom: 4px; }
.fc-pay-modal-total-row:last-child { margin-bottom: 0; }
.fc-pay-method-block { border: 1px solid #e5e5e5; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
.fc-pay-method-title { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.fc-pay-method-balance { font-size: 13px; color: #666; margin-bottom: 10px; }

/* Shipping */
.fc-shipping-display { font-size: 13px; color: #444; line-height: 1.6; }
.fc-shipping-display p { margin: 0; }
.fc-shipping-form-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* Success */
.fc-order-success { text-align: center; padding: 40px 16px; }
.fc-success-icon { font-size: 56px; margin-bottom: 12px; color: #16a34a; }
.fc-download-links { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }

/* Legacy compat */
.fc-order-item { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; font-size: 13px; }
.fc-order-item img { width: 44px; height: 44px !important; object-fit: cover; border-radius: 6px; }

/* ── Tables ── */
.fc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fc-table th, .fc-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; }
.fc-table th { background: #f9f9f9; font-weight: 600; }
.fc-table tr:last-child td { border-bottom: none; }
.fc-earnings-summary { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.fc-stat-card { flex: 1; min-width: 140px; background: #f9f9f9; border-radius: 10px; padding: 16px; text-align: center; }
.fc-stat-card .fc-stat-val { font-size: 22px; font-weight: 700; }
.fc-stat-card .fc-stat-label { font-size: 12px; color: #666; margin-top: 4px; }

/* ── Buy Coins ── */
.fc-coin-packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.fc-coin-pkg { border: 2px solid #e5e5e5; border-radius: 10px; padding: 16px; text-align: center; cursor: pointer; transition: border-color .15s; }
.fc-coin-pkg:hover, .fc-coin-pkg.selected { border-color: #111; }
.fc-coin-pkg .fc-pkg-coins { font-size: 20px; font-weight: 700; }
.fc-coin-pkg .fc-pkg-price { font-size: 13px; color: #666; margin-top: 4px; }

/* ── Modal ── */
.fc-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9998; }
.fc-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 9999; width: 400px !important; max-width: 400px !important; max-height: 90vh; overflow-y: auto; background: #fff; border-radius: 12px; box-shadow: 0 8px 40px rgba(0,0,0,.2); }
.fc-modal-inner { padding: 18px; }
.fc-modal-title { margin: 0 0 12px; font-size: 16px; font-weight: 700; line-height: 1.0; }
.fc-modal-close { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 18px; cursor: pointer; color: #666; padding: 4px 8px; }

/* ── Form fields ── */
.fc-field { margin-bottom: 10px; }
.fc-field label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 3px; line-height: 1.0; }
.fc-field input[type="text"], .fc-field input[type="number"], .fc-field input[type="email"],
.fc-field select, .fc-field textarea { width: 100%; padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; box-sizing: border-box; line-height: 1.0; }
.fc-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fc-radio-group { display: flex; gap: 14px; }
.fc-radio-group label { font-weight: 400; font-size: 12px; display: flex; align-items: center; gap: 4px; line-height: 1.0; }
.fc-req { color: #e00; }

/* ── Upload area ── */
.fc-upload-area { border: 2px dashed #ccc; border-radius: 8px; padding: 16px; cursor: pointer; min-height: 80px; transition: border-color .15s; }
.fc-upload-area:hover, .fc-drag-over { border-color: #111; }
.fc-upload-placeholder { text-align: center; color: #999; font-size: 13px; padding: 12px 0; }
.fc-upload-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fc-preview-item { position: relative; width: 72px; height: 72px; }
.fc-preview-item img { width: 100%; height: 100% !important; object-fit: cover; border-radius: 6px; }
.fc-preview-remove { position: absolute; top: -6px; right: -6px; background: #e00; color: #fff; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.fc-featured-badge { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 9px; text-align: center; border-radius: 0 0 6px 6px; padding: 2px 0; }

/* ── Misc ── */
.fc-seller-filter-label { font-size: 13px; color: #666; margin-bottom: 12px; }
.fc-seller-filter-label a { color: #2563eb; text-decoration: none; }
.fc-empty { text-align: center; color: #999; padding: 40px 0; font-size: 15px; }
.fc-msg { padding: 8px 12px; border-radius: 6px; font-size: 13px; background: #fee2e2; color: #991b1b; }
.fc-msg.fc-msg-ok { background: #dcfce7; color: #166534; }
.fc-badge { display: inline-block; background: #e00; color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 11px; text-align: center; line-height: 18px; margin-left: 4px; }

/* ── Single Product ── */
.fc-back-link { display: inline-block; margin-bottom: 16px; font-size: 13px; color: #666; text-decoration: none; }
.fc-back-link:hover { color: #111; }
.fc-product-top { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 20px; align-items: start; }
@media (max-width: 640px) { .fc-product-top { grid-template-columns: 1fr; } }
.fc-featured-img { width: 100%; height: 250px !important; object-fit: cover; border-radius: 10px; cursor: pointer; display: block; aspect-ratio: unset; }
.fc-no-img { display: flex; align-items: center; justify-content: center; font-size: 48px; color: #ccc; background: #f0f0f0; border-radius: 10px; height: 250px; }
.fc-product-info { display: flex; flex-direction: column; gap: 12px; align-self: start; border: 1px solid #e5e5e5; border-radius: 8px; padding: 16px; }
.fc-product-title { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.2; }
.fc-product-price-block { display: flex; gap: 8px; flex-wrap: wrap; }
.fc-product-price-block .fc-price-coins,
.fc-product-price-block .fc-price-usd { font-size: 15px; padding: 4px 12px; }
.fc-purchased-badge { color: #16a34a; font-weight: 600; }
.fc-product-img-strip { display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.fc-strip-img { width: 60px; height: 60px !important; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: border-color .15s, opacity .15s; flex-shrink: 0; }
.fc-strip-img:hover { border-color: #111; opacity: .9; }
.fc-product-description-wrap { margin-top: 16px; border: 1px solid #e5e5e5; border-radius: 8px; padding: 14px 16px; }
.fc-product-description-label { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.fc-product-description { font-size: 14px; line-height: 1.6; color: #444; }

/* ── Lightbox ── */
.fc-lightbox { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; }
.fc-lightbox-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.88); }
.fc-lightbox-img { position: relative; max-width: 90vw; max-height: 88vh; object-fit: contain; border-radius: 6px; z-index: 1; }
.fc-lightbox-close { position: absolute; top: 16px; right: 20px; z-index: 2; background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }
.fc-lightbox-prev, .fc-lightbox-next { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; background: rgba(255,255,255,.15); border: none; color: #fff; font-size: 36px; cursor: pointer; padding: 8px 14px; border-radius: 6px; line-height: 1; }
.fc-lightbox-prev { left: 16px; }
.fc-lightbox-next { right: 16px; }

.fc-product-info .fc-badge-digital { position: static; display: inline-block; margin-bottom: 10px; }
body.night-mode .fc-product-card,
body.night-mode .fc-modal,
body.night-mode .fc-cart-summary,
body.night-mode .fc-order-summary,
body.night-mode .fc-stat-card,
body.night-mode .fc-checkout-method { background: #2a2a2a; border-color: #444; color: #e0e0e0; }
body.night-mode .fc-chip { background: #1a1a1a; border-color: #444; color: #e0e0e0; }
body.night-mode .fc-chip:hover, body.night-mode .fc-chip-active { background: #e0e0e0; color: #111; }
body.night-mode .fc-field input, body.night-mode .fc-field select, body.night-mode .fc-field textarea { background: #1a1a1a; border-color: #444; color: #e0e0e0; }
body.night-mode .fc-upload-area { border-color: #444; background: #1a1a1a; }
body.night-mode .fc-upload-placeholder { color: #888; }
body.night-mode .fc-cart-item { background: #2a2a2a; border-color: #444; }
body.night-mode .fc-cart-item-type { color: #aaa; }
body.night-mode .fc-cart-item-img-placeholder { background: #333; }
body.night-mode .fc-cart-summary { background: #2a2a2a; }
body.night-mode .fc-summary-title, body.night-mode .fc-summary-row { color: #e0e0e0; }
body.night-mode .fc-cart-table th, body.night-mode .fc-table th { background: #1a1a1a; color: #e0e0e0; }
body.night-mode .fc-cart-table td, body.night-mode .fc-table td { border-color: #444; color: #e0e0e0; }
body.night-mode .fc-product-description { color: #aaa; }
body.night-mode .fc-btn-secondary { background: #333; color: #e0e0e0; border-color: #555; }
body.night-mode .fc-coin-pkg { border-color: #444; background: #2a2a2a; color: #e0e0e0; }
body.night-mode .fc-coin-pkg:hover, body.night-mode .fc-coin-pkg.selected { border-color: #e0e0e0; }
body.night-mode .fc-card-img-placeholder { background: #333; }
body.night-mode .fc-modal-close { color: #aaa; }
body.night-mode .fc-checkout-items { border-color: #444; background: #2a2a2a; }
body.night-mode .fc-co-item { border-color: #444; }
body.night-mode .fc-co-totals { background: #1a1a1a; border-color: #444; }
body.night-mode .fc-co-type { color: #aaa; }
body.night-mode .fc-payment-box { background: #2a2a2a; border-color: #444; color: #e0e0e0; }
body.night-mode .fc-pay-modal-totals { background: #1a1a1a; }
body.night-mode .fc-pay-method-block { border-color: #444; background: #2a2a2a; }
body.night-mode .fc-pay-method-balance { color: #aaa; }
body.night-mode .fc-shipping-display { color: #ccc; }
body.night-mode .fc-co-img-placeholder { background: #333; }
