/**
 * Promotion Builder Frontend Styles
 * Neon-style promotional page design
 *
 * @package Geek_Promotion_Builder
 * @since 1.0.0
 */

/* ============================================
   Page Layout Override
   ============================================ */
/* 移除促销页面的content-area默认padding，让Banner和内容完全控制布局 */
.promo-builder-page.content-area {
    padding: 0;
}

.promo-builder-page .site-main {
    max-width: 100%;
    width: 100%;
}

/* ============================================
   Hero Banner Slider
   ============================================ */
.promo-hero-banner-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%; /* 确保banner全宽 */
    margin-bottom: 20px;
    overflow: hidden;
}

.promo-hero-banner-wrapper .swiper {
    width: 100%;
    height: var(--banner-height-pc, 500px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.promo-hero-banner-wrapper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.promo-hero-banner-wrapper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.promo-hero-banner-wrapper .swiper-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Swiper Navigation */
.promo-hero-banner-wrapper .swiper-button-prev,
.promo-hero-banner-wrapper .swiper-button-next {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.promo-hero-banner-wrapper .swiper-button-prev:hover,
.promo-hero-banner-wrapper .swiper-button-next:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.promo-hero-banner-wrapper .swiper-button-prev::after,
.promo-hero-banner-wrapper .swiper-button-next::after {
    font-size: 20px;
}

/* Swiper Pagination */
.promo-hero-banner-wrapper .swiper-pagination {
    bottom: 20px;
}

.promo-hero-banner-wrapper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #fff;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.promo-hero-banner-wrapper .swiper-pagination-bullet-active {
    opacity: 1;
    width: 24px;
    border-radius: 6px;
    background: #fff;
}

/* Mobile */
@media (max-width: 767px) {
    .promo-hero-banner-wrapper {
        margin-bottom: 16px;
    }

    .promo-hero-banner-wrapper .swiper {
        height: var(--banner-height-mobile, 300px);
    }

    .promo-hero-banner-wrapper .swiper-button-prev,
    .promo-hero-banner-wrapper .swiper-button-next {
        width: 36px;
        height: 36px;
    }

    .promo-hero-banner-wrapper .swiper-button-prev::after,
    .promo-hero-banner-wrapper .swiper-button-next::after {
        font-size: 16px;
    }
}

/* ============================================
   Promotion Section
   ============================================ */
.promo-section {
    padding: 40px 0;
    position: relative;
}

/* 第一个section增加顶部间距 */
.promo-section:first-of-type {
    padding-top: 50px;
}

/* 最后一个section增加底部间距 */
.promo-section:last-of-type {
    padding-bottom: 50px;
}

.promo-section + .promo-section {
    border-top: 1px solid #e5e7eb;
}

/* Section Header */
.promo-section-header {
    padding: 24px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
}

.promo-section-icon {
    display: none; /* 隐藏标题图标 */
}

.promo-section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 900;
    margin: 0 0 15px;
    line-height: 1.2;
}

.promo-section-description {
    font-size: clamp(0.875rem, 1.5vw, 1rem); /* 缩小字号 */
    margin: 0 0 15px;
    line-height: 1.6;
    opacity: 0.9;
}

.promo-section-scarcity {
    font-size: 1rem;
    font-weight: 700;
    font-style: italic;
    margin: 0;
    opacity: 0.8;
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* ============================================
   Product Grid
   ============================================ */
.promo-product-grid {
    display: grid;
    grid-template-columns: repeat(var(--pc-cols, 4), 1fr);
    gap: var(--gap-row, 24px) var(--gap-col, 24px);
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Responsive Grid */
@media (max-width: 1199px) {
    .promo-product-grid {
        grid-template-columns: repeat(var(--tablet-cols, 3), 1fr);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .promo-product-grid {
        grid-template-columns: repeat(var(--mobile-cols, 2), 1fr);
        gap: 12px;
    }

    .promo-section {
        padding: 20px 0;
    }

    .promo-section:first-of-type {
        padding-top: 30px;
    }

    .promo-section:last-of-type {
        padding-bottom: 30px;
    }

    .promo-section-header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
}

/* ============================================
   Enhanced Product Card
   ============================================ */
.promo-product-card {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.promo-product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.promo-card-inner {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Card Image */
.promo-card-image {
    position: relative;
    overflow: hidden;
    background: #f9fafb;
}

.promo-card-image.ratio-1-1 {
    aspect-ratio: 1 / 1;
}

.promo-card-image.ratio-4-5 {
    aspect-ratio: 4 / 5;
}

.promo-card-image.ratio-3-4 {
    aspect-ratio: 3 / 4;
}

.promo-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.promo-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.3s ease;
}

.promo-product-card:hover .promo-card-image img {
    transform: scale(1.08);
    filter: brightness(1.05);
}

/* Sale Badge */
.promo-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 8px; /* 缩小内边距 */
    font-size: 0.625rem; /* 缩小字号到 10px */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.promo-sale-badge {
    background: #F97316; /* 橙色，更醒目但不刺眼 */
    color: #fff;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Quick View Button */
.promo-quick-view-btn {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border: none;
    border-radius: 50%;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.promo-product-card:hover .promo-quick-view-btn {
    opacity: 1;
    transform: translateY(0);
}

.promo-quick-view-btn:hover {
    background: #fff;
    transform: scale(1.15);
}

/* Variant Thumbnails (Bottom of Card) */
.promo-variant-thumbs {
    display: flex;
    gap: 4px;
    margin-top: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.promo-variant-thumb {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: border-color 0.2s ease;
    flex-shrink: 0;
}

.promo-variant-thumb:hover,
.promo-variant-thumb.active {
    border-color: #000;
}

/* Card Content */
.promo-card-content {
    padding: 20px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Product Title */
.promo-card-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.promo-card-title a {
    color: #000;
    text-decoration: none;
    transition: color 0.2s ease;
}

.promo-card-title a:hover {
    color: #667eea;
}

/* Price */
.promo-card-price {
    margin-bottom: 15px;
    font-size: 1.25rem;
    color: #000;
}

.promo-price-current {
    color: #E53E3E;
    font-weight: 700;
}

.promo-price-old {
    margin-left: 8px;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 400;
    text-decoration: line-through;
}

/* Actions */
.promo-card-actions {
    margin-top: auto;
}

.promo-card-actions .button,
.promo-card-actions .promo-add-to-cart-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.promo-card-actions .button:hover,
.promo-card-actions .promo-add-to-cart-btn:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Mobile Adjustments */
@media (max-width: 767px) {
    .promo-card-content {
        padding: 12px;
    }

    .promo-card-title {
        font-size: 0.875rem;
        margin-bottom: 10px;
    }

    .promo-card-price {
        font-size: 1.125rem;
        margin-bottom: 12px;
    }

    /* 移动端隐藏Quick View按钮 */
    .promo-quick-view-btn {
        display: none !important;
    }

    .promo-variant-thumb {
        width: 24px;
        height: 24px;
    }

    .promo-product-card:hover {
        transform: translateY(-4px);
    }

    .promo-variant-thumbs {
        gap: 3px;
        margin-top: 10px;
    }
}

/* ============================================
   Empty State
   ============================================ */
.promo-builder-empty,
.promo-no-products {
    padding: 60px 20px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

.promo-no-products {
    grid-column: 1 / -1;
}

/* ============================================
   Container
   ============================================ */
.promo-container {
    max-width: 1440px; /* 与主题container保持一致 */
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem; /* 与主题container padding保持一致 */
}

@media (max-width: 989px) {
    .promo-container {
        padding: 0 1.5rem; /* 响应式padding，与主题一致 */
    }
}

@media (max-width: 767px) {
    .promo-container {
        padding: 0 1rem; /* 移动端padding，与主题一致 */
    }
}
