/**
 * Affiliate Product Boxes - Public Styles
 */

/* Variables */
.apb-product-box,
.apb-comparison-table {
    --apb-primary: #FF9900;
    --apb-primary-dark: #E68A00;
    --apb-text: #1a1a2e;
    --apb-text-light: #6c6c8a;
    --apb-bg: #f8f9fa;
    --apb-white: #ffffff;
    --apb-border: #e0e0e0;
    --apb-green: #067D62;
    --apb-red: #B12704;
    --apb-shadow: 0 2px 10px rgba(0,0,0,0.08);
    --apb-radius: 10px;
}

/* ===================================
   PRODUCT BOX - Horizontal Style
=================================== */
.apb-product-box {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--apb-white);
    border: 1px solid var(--apb-border);
    border-radius: var(--apb-radius);
    padding: 20px;
    margin: 25px 0;
    position: relative;
    box-shadow: var(--apb-shadow);
}

.apb-product-box * {
    box-sizing: border-box;
}

/* Badge */
.apb-badge {
    position: absolute;
    top: -10px;
    left: 20px;
    background: var(--apb-primary);
    color: var(--apb-white);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

/* Inner Layout */
.apb-product-inner {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* Image */
.apb-product-image {
    flex-shrink: 0;
    width: 180px;
}

.apb-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Content */
.apb-product-content {
    flex: 1;
    min-width: 0;
}

.apb-product-title {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    line-height: 1.3;
}

.apb-product-title a {
    color: var(--apb-text);
    text-decoration: none;
}

.apb-product-title a:hover {
    color: var(--apb-primary);
}

.apb-product-brand {
    display: block;
    font-size: 0.85rem;
    color: var(--apb-text-light);
    margin-bottom: 8px;
}

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

.apb-stars {
    color: var(--apb-primary);
    font-size: 1rem;
    letter-spacing: 1px;
}

.apb-rating-num {
    font-weight: 600;
    color: var(--apb-text);
}

.apb-review-count {
    font-size: 0.85rem;
    color: var(--apb-text-light);
}

/* Description */
.apb-product-desc {
    color: var(--apb-text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

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

.apb-features li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: var(--apb-text);
}

.apb-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--apb-green);
    font-weight: bold;
}

/* Pros & Cons */
.apb-pros-cons {
    display: flex;
    gap: 20px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--apb-border);
}

.apb-pros, .apb-cons {
    flex: 1;
}

.apb-pros strong {
    color: var(--apb-green);
    font-size: 0.9rem;
}

.apb-cons strong {
    color: var(--apb-red);
    font-size: 0.9rem;
}

.apb-pros ul, .apb-cons ul {
    list-style: none;
    margin: 8px 0 0 0;
    padding: 0;
}

.apb-pros li, .apb-cons li {
    font-size: 0.85rem;
    padding: 3px 0;
    color: var(--apb-text);
}

/* Action Area */
.apb-product-action {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    padding-left: 20px;
    border-left: 1px solid var(--apb-border);
}

.apb-price-wrap {
    text-align: center;
    margin-bottom: 15px;
}

.apb-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--apb-text);
}

.apb-price-original {
    display: block;
    font-size: 1rem;
    color: var(--apb-text-light);
    text-decoration: line-through;
}

.apb-price-sale {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--apb-red);
}

/* Button */
.apb-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--apb-primary);
    color: var(--apb-white) !important;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 6px;
    text-align: center;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.apb-button:hover {
    background: var(--apb-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

/* Disclosure */
.apb-disclosure {
    font-size: 0.75rem;
    color: var(--apb-text-light);
    margin: 15px 0 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--apb-border);
    text-align: center;
}

/* ===================================
   VERTICAL STYLE
=================================== */
.apb-style-vertical .apb-product-inner {
    flex-direction: column;
    text-align: center;
}

.apb-style-vertical .apb-product-image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

.apb-style-vertical .apb-product-rating {
    justify-content: center;
}

.apb-style-vertical .apb-product-action {
    border-left: none;
    border-top: 1px solid var(--apb-border);
    padding-left: 0;
    padding-top: 20px;
    width: 100%;
}

.apb-style-vertical .apb-pros-cons {
    flex-direction: column;
    text-align: left;
}

/* ===================================
   COMPACT STYLE
=================================== */
.apb-style-compact {
    padding: 15px;
}

.apb-style-compact .apb-product-image {
    width: 100px;
}

.apb-style-compact .apb-product-title {
    font-size: 1rem;
}

.apb-style-compact .apb-product-desc,
.apb-style-compact .apb-features,
.apb-style-compact .apb-pros-cons {
    display: none;
}

.apb-style-compact .apb-product-action {
    min-width: 120px;
}

.apb-style-compact .apb-button {
    padding: 10px 18px;
    font-size: 0.85rem;
}

/* ===================================
   COMPARISON TABLE
=================================== */
.apb-comparison-table {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 25px 0;
    overflow-x: auto;
}

.apb-comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--apb-white);
    border-radius: var(--apb-radius);
    overflow: hidden;
    box-shadow: var(--apb-shadow);
}

.apb-comparison-table th {
    background: var(--apb-bg);
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--apb-text);
    border-bottom: 2px solid var(--apb-border);
}

.apb-comparison-table td {
    padding: 15px;
    border-bottom: 1px solid var(--apb-border);
    vertical-align: middle;
}

.apb-comparison-table tr:last-child td {
    border-bottom: none;
}

.apb-comparison-table tr:hover {
    background: var(--apb-bg);
}

/* Table Product Cell */
.apb-table-product {
    position: relative;
}

.apb-table-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: var(--apb-white);
}

.apb-table-product-inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

.apb-table-product-inner img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
}

.apb-table-product-inner strong {
    display: block;
    font-size: 0.95rem;
    color: var(--apb-text);
}

.apb-table-product-inner small {
    color: var(--apb-text-light);
    font-size: 0.8rem;
}

/* Table Rating */
.apb-table-rating {
    white-space: nowrap;
}

.apb-table-rating .apb-stars {
    font-size: 0.9rem;
}

/* Table Price */
.apb-table-price del {
    color: var(--apb-text-light);
    font-size: 0.85rem;
}

.apb-table-price strong {
    display: block;
    color: var(--apb-red);
    font-size: 1.1rem;
}

/* Table Action */
.apb-table-action .apb-button {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* ===================================
   RESPONSIVE
=================================== */
@media (max-width: 768px) {
    .apb-product-inner {
        flex-direction: column;
    }
    
    .apb-product-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .apb-product-action {
        border-left: none;
        border-top: 1px solid var(--apb-border);
        padding-left: 0;
        padding-top: 20px;
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .apb-price-wrap {
        margin-bottom: 0;
        text-align: left;
    }
    
    .apb-pros-cons {
        flex-direction: column;
    }
    
    .apb-comparison-table th:nth-child(2),
    .apb-comparison-table td:nth-child(2) {
        display: none;
    }
}

@media (max-width: 500px) {
    .apb-product-box {
        padding: 15px;
    }
    
    .apb-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .apb-product-title {
        font-size: 1rem;
    }
    
    .apb-table-product-inner img {
        width: 40px;
        height: 40px;
    }
}
