/**
 * Advanced Display Enhancements CSS
 * Countdown timers, galleries, videos, trust badges, etc.
 */

/* ==================== COUNTDOWN TIMER ==================== */
.apb-countdown-timer {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.apb-countdown-display {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.apb-countdown-unit {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 8px;
    min-width: 70px;
    backdrop-filter: blur(10px);
}

.apb-countdown-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #fff;
    line-height: 1;
}

.apb-countdown-label {
    display: block;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.apb-deal-expired {
    color: #fff;
    font-size: 1.2em;
    font-weight: bold;
}

/* ==================== IMAGE GALLERY ==================== */
.apb-image-gallery {
    margin: 20px 0;
}

.apb-gallery-main {
    position: relative;
    margin-bottom: 15px;
    overflow: hidden;
    border-radius: 8px;
    background: #f3f4f6;
    aspect-ratio: 4 / 3;
}

.apb-gallery-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.apb-gallery-main img.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.apb-gallery-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.apb-gallery-thumbnail {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    background: #f3f4f6;
}

.apb-gallery-thumbnail:hover {
    border-color: var(--apb-primary-color, #FF9900);
}

.apb-gallery-thumbnail.active {
    border-color: var(--apb-primary-color, #FF9900);
    box-shadow: 0 0 0 1px var(--apb-primary-color, #FF9900);
}

.apb-gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== VIDEO EMBED ==================== */
.apb-video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin: 20px 0;
    border-radius: 8px;
    background: #000;
}

.apb-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

/* ==================== BEFORE/AFTER SLIDER ==================== */
.apb-before-after-slider {
    position: relative;
    overflow: hidden;
    margin: 20px 0;
    border-radius: 8px;
    cursor: ew-resize;
    user-select: none;
}

.apb-ba-before,
.apb-ba-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.apb-ba-before {
    overflow: hidden;
    width: 50%;
    z-index: 2;
}

.apb-ba-before img,
.apb-ba-after img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.apb-ba-handle {
    position: absolute;
    top: 0;
    left: 50%;
    bottom: 0;
    width: 4px;
    background: #fff;
    z-index: 3;
    cursor: ew-resize;
    transform: translateX(-50%);
}

.apb-ba-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.apb-ba-handle::after {
    content: '⬅ ➡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    color: #333;
}

.apb-ba-label {
    position: absolute;
    top: 15px;
    padding: 5px 15px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
    z-index: 1;
}

.apb-ba-label-before {
    left: 15px;
}

.apb-ba-label-after {
    right: 15px;
}

/* ==================== TRUST BADGES ==================== */
.apb-trust-badges {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 30px 0;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.apb-trust-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.apb-trust-badge.apb-badge-visible {
    opacity: 1;
    transform: translateY(0);
}

.apb-trust-badge-icon {
    font-size: 24px;
    color: #10b981;
}

.apb-trust-badge-text {
    font-size: 0.9em;
    font-weight: 600;
    color: #374151;
}

.apb-trust-badge-subtext {
    display: block;
    font-size: 0.8em;
    font-weight: normal;
    color: #6b7280;
}

/* ==================== TESTIMONIAL CAROUSEL ==================== */
.apb-testimonial-carousel {
    position: relative;
    padding: 40px 60px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin: 30px 0;
}

.apb-testimonial-item {
    display: none;
    text-align: center;
    animation: fadeInTestimonial 0.5s ease;
}

.apb-testimonial-item.active {
    display: block;
}

@keyframes fadeInTestimonial {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.apb-testimonial-text {
    font-size: 1.2em;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 20px;
    font-style: italic;
}

.apb-testimonial-author {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.apb-testimonial-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.apb-testimonial-name {
    font-weight: 600;
    color: #111827;
}

.apb-testimonial-title {
    font-size: 0.9em;
    color: #6b7280;
}

.apb-testimonial-prev,
.apb-testimonial-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
}

.apb-testimonial-prev {
    left: 10px;
}

.apb-testimonial-next {
    right: 10px;
}

.apb-testimonial-prev:hover,
.apb-testimonial-next:hover {
    background: var(--apb-primary-color, #FF9900);
    border-color: var(--apb-primary-color, #FF9900);
    color: #fff;
}

/* ==================== PRICING TABLE ==================== */
.apb-pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.apb-pricing-column {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.apb-pricing-column.featured {
    border-color: var(--apb-primary-color, #FF9900);
    box-shadow: 0 8px 25px rgba(255, 153, 0, 0.2);
    transform: scale(1.05);
}

.apb-pricing-column.highlighted {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.apb-pricing-badge {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--apb-primary-color, #FF9900);
    color: #fff;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.apb-pricing-name {
    font-size: 1.4em;
    font-weight: 700;
    margin-bottom: 10px;
}

.apb-pricing-price {
    font-size: 3em;
    font-weight: bold;
    color: var(--apb-accent-color, #B12704);
    margin: 20px 0;
}

.apb-pricing-period {
    font-size: 0.4em;
    color: #6b7280;
    font-weight: normal;
}

.apb-pricing-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.apb-pricing-features li {
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

.apb-pricing-features li:last-child {
    border-bottom: none;
}

.apb-pricing-button {
    display: block;
    width: 100%;
    padding: 15px;
    background: var(--apb-primary-color, #FF9900);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s;
}

.apb-pricing-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ==================== STICKY ADD TO CART ==================== */
.apb-sticky-add-to-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.apb-sticky-add-to-cart.visible {
    transform: translateY(0);
}

.apb-sticky-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

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

.apb-sticky-product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.apb-sticky-product-title {
    font-weight: 600;
    font-size: 1em;
    margin: 0;
}

.apb-sticky-product-price {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--apb-accent-color, #B12704);
}

.apb-sticky-button {
    padding: 12px 40px;
    background: var(--apb-primary-color, #FF9900);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s;
}

.apb-sticky-button:hover {
    opacity: 0.9;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .apb-countdown-display {
        gap: 8px;
    }

    .apb-countdown-unit {
        padding: 10px 15px;
        min-width: 60px;
    }

    .apb-countdown-value {
        font-size: 1.5em;
    }

    .apb-testimonial-carousel {
        padding: 30px 50px;
    }

    .apb-testimonial-text {
        font-size: 1em;
    }

    .apb-pricing-table {
        grid-template-columns: 1fr;
    }

    .apb-pricing-column.featured {
        transform: none;
    }

    .apb-sticky-content {
        flex-wrap: wrap;
        gap: 10px;
    }

    .apb-sticky-product-info {
        flex: 1;
    }

    .apb-sticky-button {
        width: 100%;
        text-align: center;
    }
}
