/**
 * KB Flash Sales - Frontend CSS
 */

/* ========================================
   Homepage Banner
======================================== */
.kbfs-homepage-wrapper {
    margin: 20px 0;
}

.kbfs-campaign-banner {
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.kbfs-banner-image {
    width: 100%;
    height: auto;
    display: block;
}

.kbfs-banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}

.kbfs-label {
    display: inline-block;
    background: #ff0000;
    color: #fff;
    padding: 5px 15px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.kbfs-title {
    font-size: 24px;
    margin: 0 0 10px;
    font-weight: 700;
}

.kbfs-description {
    font-size: 14px;
    margin: 0 0 15px;
    opacity: 0.9;
}

.kbfs-discount {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

.kbfs-shop-btn {
    background: #fff;
    color: #333;
    padding: 10px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.kbfs-shop-btn:hover {
    background: #333;
    color: #fff;
}

/* ========================================
   Countdown Timer - Base Styles
======================================== */
.kbfs-countdown {
    display: inline-flex;
    gap: 10px;
    margin: 15px 0;
}

.kbfs-timer-item {
    text-align: center;
    background: var(--timer-bg, #000);
    color: var(--timer-color, #fff);
    padding: 10px 15px;
    border-radius: 4px;
    min-width: 60px;
}

.kbfs-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.kbfs-label-text {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* ========================================
   Timer Theme 1 - Classic Boxes
======================================== */
.kbfs-timer-theme1 .kbfs-timer-item {
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* ========================================
   Timer Theme 2 - Circular Progress
======================================== */
.kbfs-timer-theme2 .kbfs-timer-item {
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
}

.kbfs-timer-theme2 .kbfs-value {
    font-size: 20px;
}

/* ========================================
   Timer Theme 3 - Flip Clock Style
======================================== */
.kbfs-timer-theme3 .kbfs-timer-item {
    position: relative;
    perspective: 300px;
}

.kbfs-timer-theme3 .kbfs-value {
    background: var(--timer-bg, #000);
    padding: 10px;
    border-radius: 4px;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.3);
}

/* ========================================
   Timer Theme 4 - Minimal Inline
======================================== */
.kbfs-timer-theme4 {
    gap: 5px;
}

.kbfs-timer-theme4 .kbfs-timer-item {
    background: transparent;
    color: inherit;
    padding: 0;
    min-width: auto;
}

.kbfs-timer-theme4 .kbfs-timer-item::after {
    content: ':';
    margin-left: 5px;
}

.kbfs-timer-theme4 .kbfs-timer-item:last-child::after {
    content: '';
}

.kbfs-timer-theme4 .kbfs-label-text {
    display: none;
}

/* ========================================
   Timer Theme 5 - Bold Countdown
======================================== */
.kbfs-timer-theme5 .kbfs-timer-item {
    padding: 15px 20px;
}

.kbfs-timer-theme5 .kbfs-value {
    font-size: 36px;
}

.kbfs-timer-theme5 .kbfs-label-text {
    font-size: 11px;
    margin-top: 5px;
}

/* ========================================
   Timer Theme 6 - Gradient Boxes
======================================== */
.kbfs-timer-theme6 .kbfs-timer-item {
    background: linear-gradient(135deg, var(--timer-bg, #000), rgba(0,0,0,0.7));
    border: 1px solid rgba(255,255,255,0.1);
}

/* ========================================
   Timer Position Modifiers
======================================== */
.kbfs-position-center {
    justify-content: center;
}

.kbfs-position-top-left,
.kbfs-position-bottom-left {
    justify-content: flex-start;
}

.kbfs-position-top-right,
.kbfs-position-bottom-right {
    justify-content: flex-end;
}

/* ========================================
   Inline Countdown (Header/Footer Bar)
======================================== */
.kbfs-countdown-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.kbfs-timer-inline {
    font-family: monospace;
    font-weight: 700;
}

/* ========================================
   Header Bar
======================================== */
.kbfs-header-bar {
    width: 100%;
    padding: 10px 0;
    z-index: 1000;
}

.kbfs-bar-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.kbfs-bar-text {
    font-size: 14px;
}

.kbfs-bar-btn {
    background: rgba(255,255,255,0.2);
    color: inherit;
    padding: 5px 15px;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.3s;
}

.kbfs-bar-btn:hover {
    background: rgba(255,255,255,0.3);
    color: inherit;
}

/* ========================================
   Footer Bar
======================================== */
.kbfs-footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.kbfs-close-bar {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
}

.kbfs-close-bar:hover {
    opacity: 1;
}

/* ========================================
   Column Widget
======================================== */
.kbfs-column-widget {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.kbfs-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.kbfs-column-campaign {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.kbfs-column-campaign:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.kbfs-column-banner {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.kbfs-label-small {
    display: inline-block;
    background: #ff0000;
    color: #fff;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 5px;
}

.kbfs-column-title {
    font-size: 14px;
    margin: 0 0 8px;
}

.kbfs-column-title a {
    color: #333;
    text-decoration: none;
}

.kbfs-column-discount {
    font-size: 13px;
    color: #ff0000;
    font-weight: 600;
    margin-bottom: 10px;
}

.kbfs-countdown-compact .kbfs-compact-timer {
    font-size: 14px;
    font-weight: 700;
    font-family: monospace;
}

.kbfs-column-btn {
    display: block;
    text-align: center;
    margin-top: 10px;
}

/* ========================================
   Product Page
======================================== */
.kbfs-product-flashsale {
    background: #fff8e1;
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.kbfs-product-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.kbfs-badge-label {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
}

.kbfs-badge-discount {
    background: rgba(255,255,255,0.2);
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 700;
}

.kbfs-product-timer {
    margin: 15px 0;
}

.kbfs-ends-in {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
    color: #666;
}

/* ========================================
   Subscription Form
======================================== */
.kbfs-subscribe-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.kbfs-subscribe-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.kbfs-subscribe-form {
    display: flex;
    gap: 10px;
}

.kbfs-subscribe-form input[type="email"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.kbfs-subscribe-form button {
    padding: 8px 20px;
}

.kbfs-subscribe-message {
    display: none;
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
}

.kbfs-subscribe-message.success {
    background: #d4edda;
    color: #155724;
}

.kbfs-subscribe-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* ========================================
   Product Listing Timer
======================================== */
.kbfs-listing-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
}

.kbfs-listing-label {
    font-weight: 600;
    text-transform: uppercase;
}

.kbfs-mini-timer {
    font-family: monospace;
    font-weight: 700;
}

/* ========================================
   Slider
======================================== */
.kbfs-slider {
    position: relative;
}

.kbfs-slide {
    display: none;
}

.kbfs-slide:first-child {
    display: block;
}

.kbfs-slider-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.kbfs-slider-nav button {
    pointer-events: auto;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.kbfs-slider-nav button:hover {
    background: rgba(0,0,0,0.8);
}

.kbfs-slider-dots {
    text-align: center;
    padding: 15px 0;
}

.kbfs-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ddd;
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.kbfs-dot.active {
    background: #333;
}

/* ========================================
   Campaign Page
======================================== */
.kbfs-campaign-page {
    padding: 20px 0;
}

.kbfs-campaign-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    background-color: #333;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    min-height: 300px;
}

.kbfs-hero-banner {
    width: 100%;
    height: auto;
}

.kbfs-hero-content {
    padding: 30px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.kbfs-hero-label {
    display: inline-block;
    background: #ff0000;
    padding: 5px 15px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.kbfs-hero-title {
    font-size: 32px;
    margin: 0 0 10px;
}

.kbfs-hero-desc {
    font-size: 16px;
    margin: 0 0 15px;
    opacity: 0.9;
}

.kbfs-hero-discount {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
}

.kbfs-hero-timer h4 {
    font-size: 14px;
    margin: 0 0 10px;
    opacity: 0.8;
}

.kbfs-section-title {
    font-size: 22px;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

.kbfs-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.kbfs-product {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.kbfs-product:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.kbfs-product-inner {
    padding: 15px;
}

.kbfs-product .thumbnail {
    position: relative;
    display: block;
    margin-bottom: 15px;
}

.kbfs-product .thumbnail img {
    width: 100%;
    height: auto;
}

.kbfs-product-discount {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff0000;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
}

.kbfs-product .product-title {
    font-size: 14px;
    margin: 0 0 10px;
}

.kbfs-product .product-title a {
    color: #333;
    text-decoration: none;
}

.kbfs-product .regular-price {
    text-decoration: line-through;
    color: #999;
    font-size: 13px;
    margin-right: 5px;
}

.kbfs-product .price {
    color: #ff0000;
    font-weight: 700;
    font-size: 16px;
}

.kbfs-subscribe-section {
    margin-top: 40px;
    text-align: center;
}

.kbfs-subscribe-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 30px;
    max-width: 500px;
    margin: 0 auto;
}

.kbfs-subscribe-card h4 {
    font-size: 20px;
    margin: 0 0 10px;
}

.kbfs-subscribe-card p {
    color: #666;
    margin-bottom: 20px;
}

/* ========================================
   Urgency Progress Bar
======================================== */
.kbfs-urgency-wrapper {
    margin-top: 15px;
}

.kbfs-urgency-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.kbfs-urgency-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff8800, #ffcc00);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 100%;
}

.kbfs-urgency-text {
    font-size: 12px;
    color: #ff5722;
    font-weight: 600;
    text-align: center;
}

/* ========================================
   Cart Page Block
======================================== */
.kbfs-cart-block {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 2px solid #ff9800;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.kbfs-cart-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 152, 0, 0.3);
}

.kbfs-cart-header i {
    color: #ff9800;
    font-size: 24px;
}

.kbfs-cart-sales {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.kbfs-cart-sale {
    flex: 1;
    min-width: 280px;
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.kbfs-cart-sale-info {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.kbfs-cart-banner {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.kbfs-cart-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kbfs-cart-sale-content {
    flex: 1;
}

.kbfs-cart-sale-label {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.kbfs-cart-discount {
    font-size: 14px;
    color: #ff5722;
    font-weight: 600;
    margin-bottom: 8px;
}

.kbfs-cart-countdown {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.kbfs-cart-ends {
    font-size: 12px;
    color: #666;
}

.kbfs-cart-timer {
    display: inline-flex;
    gap: 2px;
}

.kbfs-cart-timer .kbfs-timer-item {
    display: inline-flex;
    align-items: baseline;
    background: #333;
    color: #fff;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
}

.kbfs-cart-timer .kbfs-value {
    font-weight: 700;
}

.kbfs-cart-timer .kbfs-label-text {
    font-size: 10px;
    opacity: 0.8;
    margin-left: 1px;
}

.kbfs-cart-products-count {
    font-size: 12px;
    color: #666;
}

.kbfs-cart-products-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.kbfs-cart-product-thumb {
    display: inline-block;
    font-size: 11px;
    color: #666;
    text-decoration: none;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background 0.2s;
}

.kbfs-cart-product-thumb:hover {
    background: #e0e0e0;
    color: #333;
}

.kbfs-cart-more {
    font-size: 11px;
    color: #999;
    padding: 4px 8px;
}

.kbfs-cart-view-btn {
    display: block;
    text-align: center;
    margin-top: 10px;
}

/* ========================================
   Responsive Styles
======================================== */
@media (max-width: 768px) {
    .kbfs-banner-content {
        padding: 20px;
    }

    .kbfs-title {
        font-size: 18px;
    }

    .kbfs-countdown {
        gap: 5px;
    }

    .kbfs-timer-item {
        padding: 8px 10px;
        min-width: 50px;
    }

    .kbfs-value {
        font-size: 18px;
    }

    .kbfs-bar-content {
        font-size: 12px;
    }

    .kbfs-hero-title {
        font-size: 24px;
    }

    .kbfs-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .kbfs-subscribe-form {
        flex-direction: column;
    }
}
