/**
 * Amazon Product Cards - Frontend Styles
 */

:root {
    --apc-accent: #ff9900;
    --apc-accent-hover: #e68a00;
    --apc-text-main: #1f2937;
    --apc-text-muted: #6b7280;
    --apc-card-bg: #ffffff;
    --apc-card-border: #e5e7eb;
    --apc-card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    --apc-card-hover-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    --apc-radius: 12px;
}

.apc-product-card-wrap {
    margin: 28px auto;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--apc-text-main);
    box-sizing: border-box;
}

.apc-product-card-wrap *,
.apc-product-card-wrap *::before,
.apc-product-card-wrap *::after {
    box-sizing: inherit;
}

/* Card Base */
.apc-product-card {
    position: relative;
    background: var(--apc-card-bg);
    border: 1px solid var(--apc-card-border);
    border-radius: var(--apc-radius);
    box-shadow: var(--apc-card-shadow);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.apc-product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--apc-card-hover-shadow);
    border-color: #d1d5db;
}

/* Ribbon / Badge */
.apc-product-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 5;
}

.apc-badge-text {
    display: inline-block;
    background: linear-gradient(135deg, #1f2937, #111827);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Media / Image */
.apc-card-media {
    background: #fbfbfb;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-bottom: 1px solid #f0f2f5;
    position: relative;
}

.apc-image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.apc-product-image {
    max-height: 240px;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.apc-product-card:hover .apc-product-image {
    transform: scale(1.04);
}

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

/* Content */
.apc-card-content {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
}

.apc-product-title {
    margin: 0 0 10px 0;
    font-size: 19px;
    line-height: 1.4;
    font-weight: 700;
}

.apc-product-title a {
    color: var(--apc-text-main);
    text-decoration: none;
    transition: color 0.2s ease;
}

.apc-product-title a:hover {
    color: var(--apc-accent-hover);
}

/* Rating */
.apc-product-rating-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.apc-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    color: var(--apc-accent);
}

.apc-star {
    width: 17px;
    height: 17px;
}

.apc-rating-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--apc-text-main);
    margin-left: 4px;
}

.apc-review-count {
    font-size: 13px;
    color: var(--apc-text-muted);
}

/* Price */
.apc-product-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.apc-current-price {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    letter-spacing: -0.5px;
}

.apc-regular-price {
    font-size: 15px;
    color: var(--apc-text-muted);
}

.apc-discount-tag {
    background: #ecfdf5;
    color: #065f46;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
}

/* Features */
.apc-features-list {
    margin: 0 0 20px 0;
    padding: 0;
    list-style: none;
}

.apc-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    margin-bottom: 7px;
}

.apc-features-list li:last-child {
    margin-bottom: 0;
}

.apc-check-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: #10b981;
    margin-top: 2px;
}

/* Button & CTA */
.apc-button-wrap {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 10px;
}

.apc-btn-view-product {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    background: var(--apc-accent);
    color: #111827 !important;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
    padding: 13px 26px;
    border-radius: 9999px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.28);
    transition: all 0.22s ease-in-out;
    cursor: pointer;
    flex: 1;
    max-width: 320px;
    text-align: center;
}

.apc-btn-view-product:hover {
    background: var(--apc-accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 153, 0, 0.38);
    color: #000000 !important;
}

.apc-btn-view-product:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 153, 0, 0.2);
}

.apc-btn-icon {
    width: 17px;
    height: 17px;
    transition: transform 0.2s ease;
}

.apc-btn-view-product:hover .apc-btn-icon {
    transform: translateX(2px) translateY(-2px);
}

.apc-prime-badge-wrap {
    display: flex;
    align-items: center;
}

.apc-amazon-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--apc-text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Affiliate Disclosure */
.apc-affiliate-disclosure {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.4;
    text-align: center;
    margin-top: 8px;
    padding: 0 4px;
}

/* Horizontal Layout */
.apc-product-card.apc-layout-horizontal {
    display: flex;
    flex-direction: row;
}

.apc-product-card.apc-layout-horizontal .apc-card-media {
    flex: 0 0 280px;
    max-width: 280px;
    border-bottom: 0;
    border-right: 1px solid #f0f2f5;
    padding: 24px;
}

.apc-product-card.apc-layout-horizontal .apc-card-content {
    flex: 1;
    padding: 24px 30px;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .apc-product-card.apc-layout-horizontal {
        flex-direction: column;
    }
    .apc-product-card.apc-layout-horizontal .apc-card-media {
        flex: auto;
        max-width: 100%;
        border-right: 0;
        border-bottom: 1px solid #f0f2f5;
    }
    .apc-card-content {
        padding: 18px 20px;
    }
    .apc-product-title {
        font-size: 17px;
    }
    .apc-button-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .apc-btn-view-product {
        max-width: 100%;
        width: 100%;
        padding: 14px 20px;
    }
    .apc-prime-badge-wrap {
        justify-content: center;
    }
}
