/* ==========================================================================
   DailyFishing - Affiliate AliExpress Widgets Styles
   ========================================================================== */

.aff-card-wrapper,
.aff-badge-widget,
.aff-compare-wrapper {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.aff-card-wrapper *,
.aff-badge-widget *,
.aff-compare-wrapper * {
    box-sizing: border-box;
}

/* Isolate widget internals from article typography rules */
.df-article-body .aff-card-wrapper img,
.df-article-body .aff-badge-widget img,
.df-article-body .aff-compare-wrapper img,
.aff-card-wrapper img,
.aff-badge-widget img,
.aff-compare-wrapper img {
    margin: 0;
    border-radius: 8px;
}

.type-post .entry-content .aff-card-wrapper ul,
.aff-card-wrapper ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.type-post .entry-content .aff-card-wrapper ul li,
.aff-card-wrapper ul li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.type-post .entry-content .aff-card-wrapper ul li::before,
.aff-card-wrapper ul li::before {
    content: none !important;
    display: none !important;
}

.aff-svg {
    display: block;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Product Card
   -------------------------------------------------------------------------- */

.aff-card-wrapper {
    margin: 28px 0;
}

.aff-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.045);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aff-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.aff-card-main {
    display: flex;
    align-items: stretch;
    gap: 22px;
    padding: 20px 22px;
}

.aff-card--compact .aff-media {
    flex: 0 0 160px;
    width: 160px;
}

.aff-card--detailed .aff-media {
    flex: 0 0 210px;
    width: 210px;
}

.aff-media {
    display: flex;
    align-items: flex-start;
}

.aff-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #edf2f7;
    padding: 10px;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.aff-image-link:hover {
    border-color: #fed7aa;
}

.aff-img {
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}

.aff-image-link:hover .aff-img {
    transform: scale(1.04);
}

.aff-img-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    border-radius: 8px;
    color: #cbd5e1;
}

.aff-content {
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.aff-head {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.aff-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.aff-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff4ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    line-height: 1.2;
    padding: 4px 10px;
    border-radius: 999px;
}

.aff-badge .aff-svg {
    color: #e85a19;
}

.aff-badge--deal {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.aff-badge--deal .aff-svg {
    color: #059669;
}

.aff-badge-sm {
    font-size: 10px;
    padding: 2px 7px;
    margin-left: 0;
}

.aff-brand-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.2;
}

.aff-card-wrapper h4.aff-title,
.aff-title {
    margin: 0;
    padding: 0;
    font-size: 19.5px;
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -0.015em;
    color: #141416;
    text-transform: none;
}

.aff-title a {
    color: #141416;
    text-decoration: none;
    transition: color 0.16s ease;
}

.aff-title a:hover,
.aff-title a:focus-visible {
    color: #e85a19;
    text-decoration: none;
}

.aff-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    font-size: 13px;
    color: #475569;
    font-variant-numeric: tabular-nums;
}

.aff-rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.2;
    padding: 3px 9px;
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.aff-svg-star {
    color: #f59e0b;
}

.aff-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #475569;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.aff-reviews .aff-svg {
    color: #64748b;
}

.aff-orders .aff-svg {
    color: #059669;
}

/* Detailed Specs & Pros/Cons */
.aff-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 2px;
}

.aff-specs-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    margin-bottom: 8px;
}

.aff-specs-title .aff-svg {
    color: #e85a19;
}

.aff-specs-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 6px 18px;
}

.type-post .entry-content .aff-card-wrapper .aff-specs-list li,
.aff-specs-list li {
    font-size: 13px;
    line-height: 1.45;
    color: #334155;
    padding: 5px 0;
    border-bottom: 1px dashed #e2e8f0;
}

.aff-spec-k {
    color: #64748b;
}

.aff-spec-v {
    font-weight: 600;
    color: #141416;
}

.aff-pros-cons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.aff-pros-cons--single {
    grid-template-columns: 1fr;
}

.aff-pc-box {
    border-radius: 12px;
    padding: 12px 14px;
}

.aff-pros {
    background: #f2fbf6;
    border: 1px solid #ccebd9;
}

.aff-cons {
    background: #fef5f5;
    border: 1px solid #f9d7d7;
}

.aff-pc-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.aff-pros .aff-pc-header {
    color: #065f46;
}

.aff-pros .aff-pc-header .aff-svg {
    color: #059669;
}

.aff-cons .aff-pc-header {
    color: #991b1b;
}

.aff-cons .aff-pc-header .aff-svg {
    color: #dc2626;
}

.type-post .entry-content .aff-card-wrapper .aff-pc-box li,
.aff-pc-box li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    font-size: 13px;
    line-height: 1.45;
    color: #334155;
    margin-bottom: 5px;
}

.type-post .entry-content .aff-card-wrapper .aff-pc-box li:last-child,
.aff-pc-box li:last-child {
    margin-bottom: 0;
}

.aff-pc-bullet {
    display: inline-flex;
    align-items: center;
    margin-top: 3px;
    flex-shrink: 0;
}

.aff-pros .aff-pc-bullet {
    color: #059669;
}

.aff-cons .aff-pc-bullet {
    color: #dc2626;
}

/* Purchase Bar (Inline in compact mode, Footer in detailed mode) */
.aff-purchase-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 16px;
    background: #f8fafc;
}

.aff-purchase-bar--inline {
    margin-top: auto;
    padding: 12px 16px;
    border: 1px solid #e9eef5;
    border-radius: 12px;
}

.aff-purchase-bar--footer {
    padding: 16px 22px;
    border-top: 1px solid #e9eef5;
}

.aff-price-box {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.aff-price-label {
    font-size: 12px;
    color: #64748b;
    line-height: 1.25;
}

.aff-prices {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.aff-current-price {
    font-size: 24px;
    font-weight: 700;
    color: #141416;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.aff-old-price {
    font-size: 13.5px;
    color: #94a3b8;
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
}

.aff-discount-pill {
    display: inline-flex;
    align-items: center;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.2;
    padding: 2px 7px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
}

.aff-action-box {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.aff-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #f06524 0%, #e04d10 100%);
    color: #ffffff !important;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.2;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(232, 90, 25, 0.25);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.aff-cta-btn:hover,
.aff-cta-btn:focus-visible {
    background: linear-gradient(135deg, #e55617 0%, #c9410a 100%);
    box-shadow: 0 6px 18px rgba(232, 90, 25, 0.36);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.aff-cta-btn:focus-visible {
    outline: 2px solid #e85a19;
    outline-offset: 2px;
}

.aff-cta-btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(232, 90, 25, 0.24);
}

.aff-btn-icon,
.aff-btn-arrow {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.aff-btn-arrow {
    transition: transform 0.18s ease;
}

.aff-cta-btn:hover .aff-btn-arrow {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Inline Badge Widget
   -------------------------------------------------------------------------- */

.aff-badge-widget {
    margin: 22px 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #e85a19;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.aff-badge-widget:hover {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}

.aff-badge-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.aff-badge-thumb {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    border: 1px solid #edf2f7;
    background: #ffffff;
    padding: 4px;
    overflow: hidden;
}

.aff-badge-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.aff-badge-thumb-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #cbd5e1;
}

.aff-badge-thumb-fallback .aff-svg {
    width: 24px;
    height: 24px;
}

.aff-badge-content {
    flex: 1 1 0%;
    min-width: 0;
}

.aff-badge-title {
    line-height: 1.35;
}

.aff-badge-title a {
    font-size: 15px;
    font-weight: 600;
    color: #141416;
    text-decoration: none;
    transition: color 0.16s ease;
}

.aff-badge-title a:hover {
    color: #e85a19;
}

.aff-badge-meta {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.aff-badge-price-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.aff-badge-price {
    font-size: 17px;
    font-weight: 700;
    color: #141416;
    font-variant-numeric: tabular-nums;
}

.aff-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f06524 0%, #e04d10 100%);
    color: #ffffff !important;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(232, 90, 25, 0.22);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.aff-badge-btn:hover {
    background: linear-gradient(135deg, #e55617 0%, #c9410a 100%);
    box-shadow: 0 4px 12px rgba(232, 90, 25, 0.32);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.aff-badge-btn .aff-svg {
    width: 14px;
    height: 14px;
}

/* --------------------------------------------------------------------------
   Comparison Table
   -------------------------------------------------------------------------- */

.aff-compare-wrapper {
    margin: 32px 0;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.045);
}

.aff-compare-title {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #f8fafc;
    padding: 15px 20px;
    font-size: 16.5px;
    font-weight: 700;
    color: #141416;
    border-bottom: 1px solid #e2e8f0;
}

.aff-compare-title .aff-svg {
    color: #e85a19;
}

.df-article-body .aff-compare-wrapper .aff-compare-table,
.aff-compare-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.df-article-body .aff-compare-wrapper .aff-compare-table th,
.aff-compare-table th {
    background: #f8fafc;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 11px 14px;
    vertical-align: middle;
}

.df-article-body .aff-compare-wrapper .aff-compare-table td,
.aff-compare-table td {
    border: none;
    border-bottom: 1px solid #f1f5f9;
    padding: 12px 14px;
    vertical-align: middle;
    font-size: 14px;
    color: #334155;
}

.aff-compare-table tbody tr:last-child td {
    border-bottom: none;
}

.aff-comp-product-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aff-comp-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
}

.aff-comp-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 3px;
    flex-shrink: 0;
}

.aff-comp-img-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: #cbd5e1;
    flex-shrink: 0;
}

.aff-comp-img-fallback .aff-svg {
    width: 22px;
    height: 22px;
}

.aff-comp-link {
    font-weight: 600;
    color: #141416;
    text-decoration: none;
    transition: color 0.16s ease;
}

.aff-comp-link:hover {
    color: #e85a19;
}

.aff-comp-orders {
    font-variant-numeric: tabular-nums;
    color: #475569;
    white-space: nowrap;
}

.aff-comp-price {
    font-weight: 700;
    font-size: 15px;
    color: #141416;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.aff-btn-table {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f06524 0%, #e04d10 100%);
    color: #ffffff !important;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
    padding: 7px 13px;
    border-radius: 8px;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(232, 90, 25, 0.22);
    transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.aff-btn-table:hover {
    background: linear-gradient(135deg, #e55617 0%, #c9410a 100%);
    box-shadow: 0 4px 12px rgba(232, 90, 25, 0.32);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.aff-btn-table .aff-svg {
    width: 13px;
    height: 13px;
}

/* --------------------------------------------------------------------------
   Responsive adjustments
   -------------------------------------------------------------------------- */

@media (max-width: 1199px) {
    .aff-card-main {
        padding: 18px;
        gap: 16px;
    }

    .aff-card--compact .aff-media {
        flex: 0 0 132px;
        width: 132px;
    }

    .aff-card--detailed .aff-media {
        flex: 0 0 170px;
        width: 170px;
    }

    .aff-purchase-bar--inline {
        padding: 11px 14px;
        gap: 10px;
    }

    .aff-current-price {
        font-size: 20px;
    }

    .aff-cta-btn {
        padding: 10px 14px;
        font-size: 13px;
        gap: 6px;
    }

    .aff-cta-btn .aff-svg {
        width: 14px;
        height: 14px;
    }
}

@media (max-width: 640px) {
    .aff-card-wrapper {
        margin: 22px 0;
    }

    .aff-card-wrapper h4.aff-title,
    .aff-title {
        font-size: 17px;
    }

    /* Compact card: thumbnail + title/meta at top, full-width purchase dock below */
    .aff-card--compact .aff-card-main {
        display: grid;
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 14px;
        padding: 16px;
        align-items: start;
    }

    .aff-card--compact .aff-media {
        grid-column: 1;
        grid-row: 1;
        width: 92px;
    }

    .aff-card--compact .aff-image-link {
        padding: 6px;
        border-radius: 10px;
    }

    .aff-card--compact .aff-content {
        display: contents;
    }

    .aff-card--compact .aff-head {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        gap: 7px;
    }

    .aff-card--compact .aff-purchase-bar--inline {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        padding: 12px 14px;
    }

    /* Detailed card: stacked clean flow */
    .aff-card--detailed .aff-card-main {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }

    .aff-card--detailed .aff-media {
        width: 100%;
        max-width: 210px;
        margin: 0 auto;
        flex: none;
    }

    .aff-specs-list,
    .aff-pros-cons {
        grid-template-columns: 1fr;
    }

    .aff-purchase-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .aff-purchase-bar--footer {
        padding: 14px 16px;
    }

    .aff-action-box {
        margin-left: 0;
        width: 100%;
    }

    .aff-cta-btn {
        width: 100%;
        justify-content: center;
        white-space: normal;
        text-align: center;
        padding: 12px 16px;
    }

    .aff-badge-inner {
        flex-wrap: wrap;
    }

    .aff-badge-price-col {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 4px;
    }

    /* Comparison table -> stacked mobile cards */
    .aff-compare-wrapper .table-responsive {
        border: none;
        margin: 0;
    }

    .aff-compare-table thead {
        display: none;
    }

    .aff-compare-table tbody {
        display: block;
    }

    .aff-compare-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 10px 12px;
        padding: 14px 16px;
        border-bottom: 1px solid #eef2f6;
    }

    .aff-compare-table tbody tr:last-child {
        border-bottom: none;
    }

    .df-article-body .aff-compare-wrapper .aff-compare-table td,
    .aff-compare-table td {
        padding: 0;
        border: none;
    }

    .aff-compare-table td.aff-comp-product {
        grid-column: 1 / -1;
    }

    .aff-compare-table td.aff-comp-orders {
        font-size: 12.5px;
        color: #64748b;
    }

    .aff-compare-table td.aff-comp-price {
        justify-self: end;
    }

    .aff-compare-table td:last-child {
        grid-column: 1 / -1;
    }

    .aff-btn-table {
        width: 100%;
        justify-content: center;
        padding: 9px 14px;
    }
}
