/* ==========================================================================
   1. 整体容器与基础布局
   ========================================================================== */
.kirinpos-builder-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: inherit;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.kirinpos-builder-header {
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.kirinpos-builder-header h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

/* ==========================================================================
   2. 状态栏 (Sticky Status Bar)
   ========================================================================== */
.kpb-builder-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    border-left: 4px solid #e33;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 999;
}

.kpb-selection-summary {
    flex-grow: 1;
    font-size: 15px;
    color: #555;
}

.pizza-live-price {
    font-size: 22px;
    font-weight: 800;
    color: #e33;
    white-space: nowrap;
}

/* ==========================================================================
   3. Tabs 选项卡 UI (重点补回)
   ========================================================================== */
.kpb-tabs-nav {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
    overflow-x: auto;
    scrollbar-width: none;
    /* 隐藏火狐滚动条 */
}

.kpb-tabs-nav::-webkit-scrollbar {
    display: none;
}

/* 隐藏手机端滚动条 */

.kpb-tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    color: #666;
    font-size: 16px;
    transition: all 0.2s;
}

.kpb-tab-btn:hover {
    color: #e33;
    background: #f9f9f9;
}

.kpb-tab-btn.active {
    color: #e33;
    border-bottom-color: #e33;
}

.kpb-tab-panel {
    display: none;
}

.kpb-tab-panel.active {
    display: block;
    animation: kpbFadeIn 0.3s ease;
}

@keyframes kpbFadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   4. 基础卡片系统
   ========================================================================== */

/* 优惠券专用网格：响应式 1-3 列 */
.kpps-deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 10px 0;
    align-items: stretch;
}

/* 优惠券卡片基础样式 */
.kpb-card.kpps-deal-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: left;
    cursor: default;
}

.kpb-card.kpps-deal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.1);
    border-color: #e33;
}

.kpps-deal-card-content {
    flex-grow: 1;
}

.kpps-deal-card-content h3 {
    font-size: 1.35rem;
    color: #222;
    margin: 0 0 12px 0;
    line-height: 1.3;
    font-weight: 800;
    text-transform: none;
}

.kpps-deal-card-content p {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.kpps-deal-actions {
    margin-top: 15px;
    width: 100%;
}

.kpps-deal-actions a.button.alt {
    display: block;
    width: 100%;
    background-color: #e33;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    border: none;
    transition: background 0.2s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.kpps-deal-actions a.button.alt:hover {
    background-color: #c00;
    box-shadow: 0 4px 8px rgba(224, 51, 51, 0.3);
}

/* ==========================================================================
   5. Builder 配料卡片 (小卡片)
   ========================================================================== */
.kpb-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.kpb-card {
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    position: relative;
    transition: all 0.2s;
}

.kpb-card h4 {
    font-size: 1rem !important;
}

.kpb-card.selected {
    border-color: #e33;
    background: #fff4f4;
}

.kpb-card.is-extra::after {
    content: "Extra";
    position: absolute;
    bottom: -6px;
    right: -6px;
    background: #c0392b;
    color: #fff;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   6. 数量调节器 & 配料额度 (Quantity & Quota)
   ========================================================================== */
.kpb-qty-wrap {
    display: inline-flex;
    align-items: center;
    overflow: hidden;
}

.kpb-qty-btn {
    width: 34px;
    height: 34px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpb-qty-value {
    min-width: 34px;
    text-align: center;
    font-weight: 600;
}

.kpb-free-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
}

.kpb-free-badge {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    border-radius: 20px;
    padding: 2px 10px;
    font-weight: 600;
}

/* ==========================================================================
   7. 折叠面板 (Collapsible Sections)
   ========================================================================== */
.kpb-section-header {
    cursor: pointer;
    background: #f8f9fa;
    padding: 15px 20px;
    border: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px;
    margin-bottom: 5px;
}

.kpb-section-content {
    padding: 20px;
    border-top: none;
    background: #fff;
}

/* ==========================================================================
   8. 底部导航按钮
   ========================================================================== */
.kpb-nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.kpb-nav-buttons button {
    padding: 10px 25px;
    font-size: 16px;
    border: none;
    background: #333;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

.kpb-nav-buttons button.button.alt {
    background: #e33;
}

/* 响应式微调 */
@media (max-width: 600px) {
    .kpps-deals-grid {
        grid-template-columns: 1fr;
    }

    .kpb-tabs-nav {
        margin-left: -20px;
        margin-right: -20px;
        padding: 0 20px;
    }

    .kpb-tab-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

.kpb-section-header-dark {
    background: #333 !important;
    color: #fff !important;
    padding: 12px 15px !important;
    cursor: pointer !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.kpb-section-header-dark h3 {
    margin: 0 !important;
    font-size: 1.1em !important;
    color: #fff !important;
    border: none !important;
    padding: 0 !important;
}

.kpb-section-boxed {
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 20px !important;
}

.kpb-hidden {
    display: none;
}

.kpb-success-overlay {
    text-align: center !important;
    padding: 30px 20px !important;
    background: #f6fff8 !important;
    border: 2px solid #27ae60 !important;
    border-radius: 8px !important;
    margin-top: 10px !important;
}

.kpb-success-icon {
    font-size: 3em !important;
    color: #27ae60 !important;
    margin-bottom: 10px !important;
}

.kpb-success-title {
    margin: 0 0 6px !important;
    color: #27ae60 !important;
}

.kpb-success-text {
    color: #666 !important;
    margin: 0 0 24px !important;
    font-size: 0.9em !important;
}

.kpb-success-actions {
    display: flex !important;
    gap: 12px !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
}

.kpb-toggle-icon {
    display: inline-block !important;
    transition: transform 0.3s ease !important;
    transform: rotate(0deg);
}

.kpb-section.is-collapsed .kpb-toggle-icon {
    transform: rotate(-90deg);
}

.kpb-icon-collapsed {
    transform: rotate(-90deg);
}

.kpps-status-success {
    color: #28a745 !important;
    font-weight: bold !important;
}

.kpps-db-banner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    background: #f5f5f5 !important;
    padding: 15px !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    border-left: 5px solid #e33 !important;
}

.kpps-name-large {
    font-weight: 700 !important;
    font-size: 1.2em !important;
    margin-bottom: 5px !important;
}

.kpps-summary-small {
    font-size: 0.9em !important;
    color: #666 !important;
    line-height: 1.4 !important;
}

.kpb-action-center {
    margin-top: 40px !important;
    text-align: center !important;
}

.kpb-btn-large {
    font-size: 1.2em !important;
    padding: 15px 40px !important;
}

.kpb-loader {
    text-align: center !important;
    padding: 40px !important;
    font-style: italic !important;
    color: #666 !important;
}

.kpb-justify-center {
    justify-content: center !important;
}

.kpps-db-product-selection,
.kpps-db-product-customiser {
    padding: 20px;
}

.kpps-db-product-selection .kpb-section-title {
    display: none;
}