/* Affiliate Products Pro - Public CSS */
:root {
    --app-primary: #FF6900;
    --app-primary-dark: #e05800;
    --app-text: #1a1a2e;
    --app-text-light: #6b7280;
    --app-border: #e5e7eb;
    --app-white: #ffffff;
    --app-radius: 12px;
    --app-shadow: 0 2px 16px rgba(0,0,0,.08);
    --app-shadow-hover: 0 8px 32px rgba(0,0,0,.14);
}

/* ── Product Card ── */
.app-product-card {
    position: relative;
    background: var(--app-white);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    overflow: hidden;
    box-shadow: var(--app-shadow);
    transition: box-shadow .2s ease, transform .2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.app-product-card:hover {
    box-shadow: var(--app-shadow-hover);
    transform: translateY(-3px);
}

/* Badge and discount */
.app-product-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #fff3cd;
    color: #856404;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.app-discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff3b30;
    color: white;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 2;
    letter-spacing: -.3px;
}

/* Image */
.app-product-image {
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    min-height: 180px;
    overflow: hidden;
}
.app-product-image img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    transition: transform .3s ease;
}
.app-product-card:hover .app-product-image img {
    transform: scale(1.04);
}

/* Body */
.app-product-body {
    padding: 16px;
}

/* Platform badge */
.app-product-platform {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 8px;
}
.app-platform-mercadolivre { background: #FFF3B0; color: #856900; }
.app-platform-amazon       { background: #FFF0D9; color: #7a4800; }
.app-platform-shopee       { background: #FFE8E5; color: #a0300e; }

/* Title */
.app-product-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--app-text);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rating */
.app-product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 10px;
}
.star { font-size: 14px; }
.star.full, .star.half { color: #f5a623; }
.star.empty { color: #d1d5db; }
.app-review-count {
    font-size: 12px;
    color: var(--app-text-light);
}

/* Price */
.app-product-price-wrap { margin-bottom: 10px; }
.app-price-old {
    font-size: 12px;
    color: var(--app-text-light);
    text-decoration: line-through;
    line-height: 1.2;
}
.app-price-current {
    font-size: 22px;
    font-weight: 800;
    color: var(--app-text);
    line-height: 1.2;
}

/* Coupon */
.app-coupon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0fdf4;
    border: 1px dashed #86efac;
    border-radius: 6px;
    padding: 5px 10px;
    margin-bottom: 10px;
    font-size: 12px;
}
.app-coupon-label { color: #15803d; font-weight: 600; }
.app-coupon-code {
    background: #15803d;
    color: white;
    padding: 1px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .5px;
    cursor: pointer;
    font-family: monospace;
}

/* Meta */
.app-product-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.app-free-shipping {
    font-size: 12px;
    color: #15803d;
    font-weight: 600;
}
.app-out-of-stock {
    font-size: 12px;
    color: #ef4444;
    font-weight: 600;
}

/* Buy Button */
.app-buy-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--app-primary);
    color: white !important;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    transition: filter .15s ease, transform .1s ease;
    box-sizing: border-box;
    cursor: pointer;
    border: none;
    letter-spacing: .3px;
}
.app-buy-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    color: white !important;
    text-decoration: none !important;
}
.app-buy-btn:active { transform: translateY(0); filter: brightness(.96); }
.app-buy-btn-sm {
    display: inline-block;
    width: auto;
    padding: 8px 14px;
    font-size: 12px;
}

/* ── Grid ── */
.app-products-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}
.app-grid-cols-1 { grid-template-columns: 1fr; }
.app-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.app-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.app-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.app-grid-item { display: flex; flex-direction: column; }
.app-grid-item .app-product-card { height: 100%; display: flex; flex-direction: column; }
.app-grid-item .app-product-body { flex: 1; display: flex; flex-direction: column; }
.app-grid-item .app-buy-btn { margin-top: auto; }

@media (max-width: 900px) {
    .app-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .app-grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .app-grid-cols-2,
    .app-grid-cols-3,
    .app-grid-cols-4 { grid-template-columns: 1fr; }
}

/* ── Compact Card ── */
.app-product-compact {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    background: var(--app-white);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.app-compact-image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    background: #f9fafb;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-compact-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.app-compact-body { flex: 1; min-width: 0; }
.app-product-title-sm {
    font-size: 13px;
    font-weight: 600;
    color: var(--app-text);
    margin: 0 0 4px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-price-current-sm {
    font-size: 16px;
    font-weight: 800;
    color: var(--app-text);
    margin-bottom: 8px;
}

/* ── Compare Table ── */
.app-compare-wrap {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: var(--app-radius);
    border: 1px solid var(--app-border);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.app-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}
.app-compare-table thead tr {
    background: #f9fafb;
}
.app-compare-table th {
    padding: 16px;
    text-align: center;
    font-weight: 700;
    color: var(--app-text);
    border-bottom: 2px solid var(--app-border);
    min-width: 160px;
}
.app-compare-table th.app-compare-label-col {
    text-align: left;
    min-width: 100px;
    color: var(--app-text-light);
}
.app-compare-table th img {
    display: block;
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin: 0 auto 8px;
    background: #f9fafb;
}
.app-compare-title {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    max-height: 3.6em;
    overflow: hidden;
}
.app-compare-table td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.app-compare-table td.app-compare-label {
    text-align: left;
    font-weight: 600;
    color: var(--app-text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
    background: #fafafa;
}
.app-compare-table tbody tr:last-child td { border-bottom: none; }
.app-compare-table tbody tr:hover td { background: #fafafa; }
.app-compare-table td.app-compare-label:hover { background: #f0f0f0; }
.app-compare-cta-row td { padding: 16px; background: #f9fafb; }
.app-compare-cta-row .app-buy-btn { width: auto; display: inline-block; padding: 10px 18px; font-size: 13px; }
