/* ============================================
   Affiliate Amazon — Frontend Product Styles
   ============================================ */

/* --- Container --- */
.aff-amz-products-wrapper {
    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* --- Standard Card --- */
.aff-amz-product-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin: 16px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.aff-amz-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.aff-amz-product-image {
    flex-shrink: 0;
    width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aff-amz-product-image img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: 8px;
}

.aff-amz-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.aff-amz-product-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 6px;
    color: #1a202c;
}

.aff-amz-product-title a {
    color: inherit;
    text-decoration: none;
}

.aff-amz-product-title a:hover {
    color: #ff9900;
}

.aff-amz-product-brand {
    font-size: 13px;
    color: #718096;
    margin-bottom: 8px;
}

.aff-amz-product-description {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aff-amz-product-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    padding-top: 12px;
}

.aff-amz-product-price {
    font-size: 22px;
    font-weight: 700;
    color: #b12704;
}

/* Price badges */
.aff-amz-price-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

.aff-amz-price-drop {
    background: #edfaef;
    color: #00a32a;
}

.aff-amz-price-rise {
    background: #fcf0f1;
    color: #d63638;
}

.aff-amz-price-lowest {
    background: #ff9900;
    color: #fff;
    animation: aff-amz-pulse 2s infinite;
}

@keyframes aff-amz-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.aff-amz-buy-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    border: 1px solid #a88734;
    border-radius: 8px;
    color: #111;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.aff-amz-buy-button:hover {
    background: linear-gradient(to bottom, #f5d78e, #eeb933);
    color: #111;
    text-decoration: none;
}

.aff-amz-buy-button svg {
    flex-shrink: 0;
}

/* --- Compact Card --- */
.aff-amz-product-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 12px 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.aff-amz-compact-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.aff-amz-compact-info {
    flex: 1;
    min-width: 0;
}

.aff-amz-compact-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aff-amz-compact-title:hover {
    color: #ff9900;
}

.aff-amz-compact-price {
    font-size: 14px;
    font-weight: 700;
    color: #b12704;
}

.aff-amz-compact-btn {
    padding: 6px 16px;
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    border: 1px solid #a88734;
    border-radius: 6px;
    color: #111;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.aff-amz-compact-btn:hover {
    background: linear-gradient(to bottom, #f5d78e, #eeb933);
    color: #111;
    text-decoration: none;
}

/* --- Grid Layout --- */
.aff-amz-product-grid {
    display: grid;
    gap: 16px;
    margin: 24px 0;
}

.aff-amz-product-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.aff-amz-product-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.aff-amz-product-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.aff-amz-product-grid .aff-amz-product-card {
    flex-direction: column;
    margin: 0;
}

.aff-amz-product-grid .aff-amz-product-image {
    width: 100%;
    height: 180px;
}

.aff-amz-product-grid .aff-amz-product-title {
    font-size: 15px;
}

.aff-amz-product-grid .aff-amz-product-footer {
    flex-direction: column;
    align-items: stretch;
}

.aff-amz-product-grid .aff-amz-buy-button {
    justify-content: center;
    text-align: center;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .aff-amz-product-card {
        flex-direction: column;
        padding: 16px;
    }

    .aff-amz-product-image {
        width: 100%;
        height: auto;
    }

    .aff-amz-product-image img {
        max-height: 200px;
    }

    .aff-amz-product-grid[data-columns="3"],
    .aff-amz-product-grid[data-columns="2"] {
        grid-template-columns: 1fr;
    }

    .aff-amz-product-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .aff-amz-buy-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .aff-amz-product-title {
        font-size: 16px;
    }

    .aff-amz-product-price {
        font-size: 18px;
    }
}

/* --- RTL Support --- */
[dir="rtl"] .aff-amz-product-card,
.rtl .aff-amz-product-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .aff-amz-product-info,
.rtl .aff-amz-product-info {
    text-align: right;
}

[dir="rtl"] .aff-amz-product-compact,
.rtl .aff-amz-product-compact {
    flex-direction: row-reverse;
}

[dir="rtl"] .aff-amz-compact-info,
.rtl .aff-amz-compact-info {
    text-align: right;
}

[dir="rtl"] .aff-amz-product-footer,
.rtl .aff-amz-product-footer {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    [dir="rtl"] .aff-amz-product-card,
    .rtl .aff-amz-product-card {
        flex-direction: column;
    }

    [dir="rtl"] .aff-amz-product-footer,
    .rtl .aff-amz-product-footer {
        flex-direction: column;
        align-items: flex-end;
    }
}

/* --- Amazon Disclosure --- */
.aff-amz-disclosure {
    font-size: 11px;
    color: #a0aec0;
    text-align: center;
    margin: 8px 0 0;
    font-style: italic;
}

/* --- Product Badges --- */
.aff-amz-product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}

.aff-amz-product-badges span {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.aff-amz-badge-prime {
    background: #232f3e;
    color: #00a8e1;
}

.aff-amz-badge-save {
    background: #cc0c39;
    color: #fff;
}

.aff-amz-badge-deal {
    background: #ff9900;
    color: #111;
}

.aff-amz-badge-rating {
    background: #fef3cd;
    color: #856404;
}

.aff-amz-badge-rating small {
    font-weight: 400;
    opacity: 0.7;
}

/* --- FTC Disclosure Box --- */
.aff-amz-disclosure-box {
    background: #f0f6fc;
    border: 1px solid #c8d7e1;
    border-left: 4px solid #2271b1;
    border-radius: 0 4px 4px 0;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 13px;
    color: #50575e;
    line-height: 1.5;
}

.aff-amz-disclosure-box p { margin: 0; }

/* --- Comparison Table --- */
.aff-amz-comparison-table {
    margin: 24px 0;
    overflow-x: auto;
}

.aff-amz-comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.aff-amz-comparison-table thead th {
    background: #f8fafc;
    padding: 16px 12px;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    vertical-align: top;
}

.aff-amz-comparison-table thead th img {
    display: block;
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 8px;
}

.aff-amz-comparison-table thead th span {
    display: block;
    line-height: 1.3;
}

.aff-amz-comparison-table tbody td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #f0f0f1;
    font-size: 14px;
}

.aff-amz-comparison-table tbody td:first-child {
    text-align: left;
    background: #f8fafc;
    min-width: 100px;
}

.aff-compare-price {
    color: #b12704;
    font-weight: 700;
    font-size: 18px;
}

.aff-amz-comparison-table .aff-amz-buy-button {
    font-size: 13px;
    padding: 8px 16px;
}

/* ============================================
   Card Style: DARK
   ============================================ */
.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-card {
    background: #1a1a2e;
    border-color: #16213e;
    color: #e2e8f0;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-title {
    color: #f7fafc;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-title a {
    color: #f7fafc;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-title a:hover {
    color: #ffc857;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-brand {
    color: #a0aec0;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-description {
    color: #cbd5e0;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-price {
    color: #ffc857;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-buy-button {
    background: linear-gradient(to bottom, #ffc857, #e6a817);
    border-color: #c9941a;
    color: #1a1a2e;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-buy-button:hover {
    background: linear-gradient(to bottom, #ffd470, #ffc857);
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-image {
    background: #16213e;
    border-radius: 8px;
}

/* Dark - Compact */
.aff-amz-products-wrapper[data-style="dark"] .aff-amz-product-compact {
    background: #1a1a2e;
    border-color: #16213e;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-compact-title {
    color: #f7fafc;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-compact-price {
    color: #ffc857;
}

.aff-amz-products-wrapper[data-style="dark"] .aff-amz-compact-btn {
    background: linear-gradient(to bottom, #ffc857, #e6a817);
    border-color: #c9941a;
    color: #1a1a2e;
}

/* ============================================
   Card Style: MINIMAL
   ============================================ */
.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-product-card {
    border: none;
    border-bottom: 2px solid #edf2f7;
    border-radius: 0;
    box-shadow: none;
    padding: 16px 0;
    background: transparent;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-product-card:hover {
    box-shadow: none;
    transform: none;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-product-image {
    width: 100px;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-product-image img {
    max-height: 100px;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-product-title {
    font-size: 16px;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-product-description {
    display: none;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-buy-button {
    background: transparent;
    border: 2px solid #ff9900;
    color: #ff9900;
    border-radius: 4px;
    padding: 8px 20px;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-buy-button:hover {
    background: #ff9900;
    color: #fff;
}

/* Minimal - Compact */
.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-product-compact {
    border: none;
    border-bottom: 1px solid #edf2f7;
    border-radius: 0;
    background: transparent;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-compact-btn {
    background: transparent;
    border: 2px solid #ff9900;
    color: #ff9900;
}

.aff-amz-products-wrapper[data-style="minimal"] .aff-amz-compact-btn:hover {
    background: #ff9900;
    color: #fff;
}

/* ============================================
   Card Style: MODERN
   ============================================ */
.aff-amz-products-wrapper[data-style="modern"] .aff-amz-product-card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 24px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.aff-amz-products-wrapper[data-style="modern"] .aff-amz-product-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.aff-amz-products-wrapper[data-style="modern"] .aff-amz-product-image img {
    border-radius: 12px;
}

.aff-amz-products-wrapper[data-style="modern"] .aff-amz-product-title {
    font-size: 20px;
    font-weight: 700;
}

.aff-amz-products-wrapper[data-style="modern"] .aff-amz-product-price {
    font-size: 24px;
    background: linear-gradient(135deg, #ff6b35, #ff9900);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.aff-amz-products-wrapper[data-style="modern"] .aff-amz-buy-button {
    background: linear-gradient(135deg, #ff6b35 0%, #ff9900 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    padding: 12px 28px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.aff-amz-products-wrapper[data-style="modern"] .aff-amz-buy-button:hover {
    background: linear-gradient(135deg, #e5592d 0%, #e68a00 100%);
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

/* Modern - Compact */
.aff-amz-products-wrapper[data-style="modern"] .aff-amz-product-compact {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.aff-amz-products-wrapper[data-style="modern"] .aff-amz-compact-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #ff9900 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
}

.aff-amz-products-wrapper[data-style="modern"] .aff-amz-compact-btn:hover {
    background: linear-gradient(135deg, #e5592d 0%, #e68a00 100%);
    color: #fff;
}

/* ============================================
   Card Style: ELEGANT
   ============================================ */
.aff-amz-products-wrapper[data-style="elegant"] .aff-amz-product-card {
    border: 1px solid #d4c5a9;
    border-radius: 4px;
    box-shadow: none;
    padding: 20px;
    background: #fffef7;
    position: relative;
}

.aff-amz-products-wrapper[data-style="elegant"] .aff-amz-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, #c9a84c, #f0d78c, #c9a84c);
}

.aff-amz-products-wrapper[data-style="elegant"] .aff-amz-product-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    color: #2d2006;
}

.aff-amz-products-wrapper[data-style="elegant"] .aff-amz-product-title a {
    color: #2d2006;
}

.aff-amz-products-wrapper[data-style="elegant"] .aff-amz-product-price {
    color: #8b6914;
    font-family: Georgia, serif;
}

.aff-amz-products-wrapper[data-style="elegant"] .aff-amz-buy-button {
    background: linear-gradient(to bottom, #c9a84c, #a8882d);
    border: 1px solid #8b6914;
    color: #fff;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

.aff-amz-products-wrapper[data-style="elegant"] .aff-amz-buy-button:hover {
    background: linear-gradient(to bottom, #d4b85a, #c9a84c);
    color: #fff;
}
