/**
 * WooCommerce Book Bundle Builder - Frontend Styles v5
 * Fixed: CYOB layout, square images
 */

/* CSS Variables */
:root {
    --wbb-primary: #fcb800;
    --wbb-primary-dark: #e5a800;
    --wbb-primary-light: #fff8e1;
    --wbb-secondary: #222222;
    --wbb-text: #333333;
    --wbb-text-light: #666666;
    --wbb-text-muted: #999999;
    --wbb-border: #e5e5e5;
    --wbb-border-light: #f0f0f0;
    --wbb-bg: #ffffff;
    --wbb-bg-alt: #f8f9fa;
    --wbb-bg-dark: #f0f0f0;
    --wbb-success: #28a745;
    --wbb-success-light: #d4edda;
    --wbb-error: #dc3545;
    --wbb-error-light: #f8d7da;
    --wbb-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --wbb-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --wbb-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --wbb-radius-sm: 8px;
    --wbb-radius: 12px;
    --wbb-radius-lg: 16px;
    --wbb-transition: all 0.25s ease;
    --wbb-transition-fast: all 0.15s ease;
}

/* ========================================
   BUILDER CONTAINER
   ======================================== */

.wbb-builder {
    max-width: 100%;
    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.wbb-builder * {
    box-sizing: border-box;
}

/* ========================================
   CYOB PRICE NOTICE
   ======================================== */

.wbb-cyob-price-notice {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-radius: var(--wbb-radius);
    padding: 16px 20px;
    margin: 16px 0;
    text-align: center;
}

.wbb-cyob-price-notice p {
    margin: 0;
    font-size: 14px;
    color: #2e7d32;
    line-height: 1.5;
}

.wbb-cyob-price-notice p:first-child {
    font-weight: 600;
    margin-bottom: 4px;
}

.wbb-cyob-price-notice p:last-child {
    font-size: 13px;
    color: #388e3c;
}

/* ========================================
   BUILDER HEADERS
   ======================================== */

.wbb-builder-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--wbb-secondary);
    margin: 0 0 8px;
    letter-spacing: -0.3px;
}

.wbb-builder-subtitle {
    font-size: 15px;
    color: var(--wbb-text-light);
    margin: 0 0 20px;
    line-height: 1.5;
}

.wbb-fixed-header,
.wbb-cyob-header {
    margin-bottom: 20px;
}

/* Discount Badge in Header */
.wbb-discount-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    margin-left: 12px;
    vertical-align: middle;
    animation: wbbPulse 2s ease-in-out infinite;
}

.wbb-discount-badge svg {
    width: 16px;
    height: 16px;
}

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

/* ========================================
   SEARCH & FILTER BAR
   ======================================== */

.wbb-filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--wbb-bg-alt);
    border-radius: var(--wbb-radius);
    flex-wrap: wrap;
    align-items: center;
}

.wbb-search-wrap {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 280px;
}

.wbb-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wbb-text-muted);
    pointer-events: none;
    z-index: 1;
}

.wbb-search-input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    border: 2px solid var(--wbb-border);
    border-radius: 50px;
    font-size: 14px;
    background: var(--wbb-bg);
    transition: var(--wbb-transition);
}

.wbb-search-input:focus {
    outline: none;
    border-color: var(--wbb-primary);
    box-shadow: 0 0 0 3px var(--wbb-primary-light);
}

.wbb-search-input::placeholder {
    color: var(--wbb-text-muted);
}

.wbb-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--wbb-bg-dark);
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--wbb-text-muted);
    transition: var(--wbb-transition-fast);
}

.wbb-search-clear:hover {
    background: var(--wbb-error-light);
    color: var(--wbb-error);
}

.wbb-category-filter {
    min-width: 160px;
}

.wbb-category-select {
    width: 100%;
    padding: 12px 36px 12px 14px;
    border: 2px solid var(--wbb-border);
    border-radius: 50px;
    font-size: 14px;
    background: var(--wbb-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    cursor: pointer;
    transition: var(--wbb-transition);
}

.wbb-category-select:focus {
    outline: none;
    border-color: var(--wbb-primary);
}

.wbb-filter-count {
    font-size: 13px;
    color: var(--wbb-text-muted);
    margin-left: auto;
}

/* ========================================
   TAB NAVIGATION (Fixed Bundle)
   ======================================== */

.wbb-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 14px;
    background: var(--wbb-bg-alt);
    border-radius: var(--wbb-radius-lg);
}

.wbb-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--wbb-bg);
    border: 2px solid transparent;
    border-radius: var(--wbb-radius);
    cursor: pointer;
    transition: var(--wbb-transition);
    font-weight: 600;
    font-size: 14px;
    color: var(--wbb-text-light);
    box-shadow: var(--wbb-shadow-sm);
}

.wbb-tab:hover {
    border-color: var(--wbb-primary);
    color: var(--wbb-text);
}

.wbb-tab.active {
    background: var(--wbb-primary);
    border-color: var(--wbb-primary);
    color: var(--wbb-secondary);
}

.wbb-tab.completed {
    background: var(--wbb-success);
    border-color: var(--wbb-success);
    color: white;
}

.wbb-tab-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--wbb-bg-alt);
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}

.wbb-tab.active .wbb-tab-number,
.wbb-tab.completed .wbb-tab-number {
    background: rgba(255, 255, 255, 0.3);
}

.wbb-tab-label {
    white-space: nowrap;
}

.wbb-tab-selected {
    display: none;
    font-size: 11px;
    opacity: 0.9;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wbb-tab.completed .wbb-tab-selected {
    display: block;
}

.wbb-tab-review {
    margin-left: auto;
}

.wbb-tab-icon {
    display: flex;
    align-items: center;
}

/* ========================================
   PANEL STYLES (Fixed Bundle)
   ======================================== */

.wbb-panels {
    min-height: 350px;
}

.wbb-panel {
    display: none;
    animation: wbbFadeSlide 0.3s ease;
}

.wbb-panel.active {
    display: block;
}

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

.wbb-panel-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--wbb-text);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--wbb-border-light);
}

/* ========================================
   BOOKS GRID - 3 columns with scroll, SQUARE images
   ======================================== */

.wbb-books-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    max-height: 480px;
    overflow-y: auto;
    padding: 4px;
    padding-right: 10px;
}

.wbb-books-grid::-webkit-scrollbar {
    width: 6px;
}

.wbb-books-grid::-webkit-scrollbar-track {
    background: var(--wbb-bg-alt);
    border-radius: 3px;
}

.wbb-books-grid::-webkit-scrollbar-thumb {
    background: var(--wbb-border);
    border-radius: 3px;
}

.wbb-books-grid::-webkit-scrollbar-thumb:hover {
    background: var(--wbb-text-muted);
}

/* ========================================
   BOOK CARD - SQUARE RATIO
   ======================================== */

.wbb-book-card {
    background: var(--wbb-bg);
    border: 2px solid var(--wbb-border);
    border-radius: var(--wbb-radius);
    overflow: hidden;
    transition: var(--wbb-transition);
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.wbb-book-card:hover {
    border-color: var(--wbb-primary);
    box-shadow: var(--wbb-shadow);
    transform: translateY(-3px);
}

.wbb-book-card.selected {
    border-color: var(--wbb-success);
    border-width: 3px;
    box-shadow: 0 0 0 3px var(--wbb-success-light);
}

.wbb-book-card.disabled {
    opacity: 0.4;
    pointer-events: none;
    filter: grayscale(40%);
}

.wbb-book-card.wbb-hidden {
    display: none !important;
}

/* Book Image - SQUARE 1:1 Ratio */
.wbb-book-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 square ratio */
    background: var(--wbb-bg-alt);
    overflow: hidden;
}

.wbb-book-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--wbb-transition);
}

.wbb-book-card:hover .wbb-book-image {
    transform: scale(1.05);
}

/* Book Overlay */
.wbb-book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    opacity: 0;
    transition: var(--wbb-transition);
}

.wbb-book-card:hover .wbb-book-overlay {
    opacity: 1;
}

.wbb-preview-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    background: var(--wbb-bg);
    color: var(--wbb-text);
    border-radius: 50px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: var(--wbb-transition-fast);
    box-shadow: var(--wbb-shadow);
}

.wbb-preview-link:hover {
    background: var(--wbb-primary);
    color: var(--wbb-secondary);
}

/* Selected Badge */
.wbb-selected-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: var(--wbb-success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: scale(0) rotate(-90deg);
    transition: var(--wbb-transition);
    box-shadow: var(--wbb-shadow);
    z-index: 5;
}

.wbb-book-card.selected .wbb-selected-badge {
    opacity: 1;
    transform: scale(1) rotate(0);
}

/* Book Info */
.wbb-book-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--wbb-bg);
}

.wbb-book-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--wbb-text);
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 35px;
}

.wbb-book-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--wbb-primary-dark);
}

.wbb-book-price del {
    color: var(--wbb-text-muted);
    font-weight: 400;
    font-size: 12px;
}

/* Select Button */
.wbb-select-book {
    width: calc(100% - 20px);
    margin: 0 10px 10px;
    padding: 10px 12px;
    background: var(--wbb-secondary);
    color: white;
    border: none;
    border-radius: var(--wbb-radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wbb-transition-fast);
}

.wbb-select-book:hover {
    background: var(--wbb-primary);
    color: var(--wbb-secondary);
}

.wbb-select-book .wbb-btn-selected {
    display: none;
}

.wbb-select-book .wbb-btn-default {
    display: inline;
}

.wbb-book-card.selected .wbb-select-book {
    background: var(--wbb-success);
    color: white;
}

.wbb-book-card.selected .wbb-select-book .wbb-btn-default {
    display: none;
}

.wbb-book-card.selected .wbb-select-book .wbb-btn-selected {
    display: inline;
}

.wbb-book-card.selected .wbb-select-book::before {
    content: "✓ ";
}

/* ========================================
   CYOB LAYOUT - Full Width with Bottom Summary
   ======================================== */

.wbb-cyob-builder .wbb-books-grid {
    margin-bottom: 24px;
}

/* CYOB Summary - Bottom Section */
.wbb-cyob-summary-bottom {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    padding: 24px;
    background: var(--wbb-bg-alt);
    border-radius: var(--wbb-radius-lg);
    margin-top: 20px;
}

.wbb-summary-selected {
    min-width: 0;
}

.wbb-summary-header-inline {
    margin-bottom: 16px;
}

.wbb-summary-header-inline h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--wbb-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wbb-summary-header-inline .wbb-summary-count {
    font-size: 14px;
    font-weight: 500;
    color: var(--wbb-text-light);
}

.wbb-summary-items-inline {
    min-height: 60px;
}

.wbb-summary-items-inline .wbb-summary-empty {
    padding: 20px;
    text-align: center;
    color: var(--wbb-text-muted);
    background: var(--wbb-bg);
    border-radius: var(--wbb-radius);
    border: 2px dashed var(--wbb-border);
}

.wbb-summary-items-inline .wbb-summary-empty p {
    margin: 0;
    font-size: 14px;
}

.wbb-summary-items-inline .wbb-summary-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wbb-cyob-builder .wbb-summary-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--wbb-bg);
    border-radius: var(--wbb-radius-sm);
    border: 1px solid var(--wbb-border);
}

.wbb-cyob-builder .wbb-summary-item-image {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
}

.wbb-cyob-builder .wbb-summary-item-info {
    flex: 1;
}

.wbb-cyob-builder .wbb-summary-item-title {
    font-size: 12px;
    font-weight: 600;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wbb-cyob-builder .wbb-summary-item-price {
    font-size: 11px;
    color: var(--wbb-primary-dark);
}

.wbb-cyob-builder .wbb-summary-item-remove {
    padding: 4px;
}

/* Summary Checkout Section */
.wbb-summary-checkout {
    background: var(--wbb-bg);
    padding: 20px;
    border-radius: var(--wbb-radius);
    border: 2px solid var(--wbb-border);
}

.wbb-summary-checkout .wbb-summary-goody {
    margin-bottom: 16px;
}

.wbb-summary-checkout .wbb-summary-pricing {
    padding: 16px 0;
    border-top: none;
    border-bottom: 2px solid var(--wbb-border-light);
    margin-bottom: 16px;
}

.wbb-summary-checkout .wbb-summary-warning {
    margin-bottom: 12px;
}

/* Hide old sidebar styles for CYOB */
.wbb-cyob-layout {
    display: none;
}

.wbb-cyob-summary {
    display: none;
}

/* Free Goody in Summary */
.wbb-summary-goody {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-radius: var(--wbb-radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #e65100;
    border: 1px dashed #ffa000;
}

.wbb-goody-badge {
    font-size: 20px;
}

/* Summary Pricing */
.wbb-summary-pricing {
    padding: 16px 0;
    border-top: 2px solid var(--wbb-border-light);
    border-bottom: 2px solid var(--wbb-border-light);
    margin-bottom: 16px;
}

.wbb-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.wbb-price-row.wbb-subtotal {
    color: var(--wbb-text-light);
}

.wbb-price-row.wbb-discount {
    color: var(--wbb-success);
    font-weight: 600;
}

.wbb-price-row.wbb-discount .wbb-discount-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wbb-discount-percent {
    background: var(--wbb-success);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.wbb-price-row.wbb-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--wbb-secondary);
    padding-top: 12px;
    margin-top: 6px;
    border-top: 2px dashed var(--wbb-border);
}

.wbb-total-amount {
    color: var(--wbb-primary-dark);
}

/* Summary Warning */
.wbb-summary-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--wbb-radius-sm);
    padding: 12px;
    margin-bottom: 14px;
    text-align: center;
}

.wbb-summary-warning p {
    margin: 0;
    font-size: 12px;
    color: #856404;
    font-weight: 500;
}

/* ========================================
   REVIEW PANEL (Fixed Bundle)
   ======================================== */

.wbb-panel-review .wbb-review-content {
    background: var(--wbb-bg-alt);
    border-radius: var(--wbb-radius-lg);
    padding: 24px;
}

.wbb-selected-books h5 {
    font-size: 15px;
    margin: 0 0 16px;
    color: var(--wbb-text);
}

.wbb-selected-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.wbb-selected-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    padding: 14px;
    border-radius: var(--wbb-radius);
    box-shadow: var(--wbb-shadow-sm);
}

.wbb-selected-item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.wbb-selected-item-info {
    flex: 1;
}

.wbb-selected-item-title {
    font-weight: 600;
    color: var(--wbb-text);
    margin-bottom: 4px;
    font-size: 14px;
}

.wbb-selected-item-link {
    font-size: 12px;
    color: var(--wbb-primary-dark);
    text-decoration: none;
    font-weight: 500;
}

.wbb-selected-item-link:hover {
    text-decoration: underline;
}

.wbb-selected-item-remove {
    background: none;
    border: none;
    color: var(--wbb-text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--wbb-transition-fast);
}

.wbb-selected-item-remove:hover {
    background: var(--wbb-error-light);
    color: var(--wbb-error);
}

.wbb-placeholder {
    opacity: 0.6;
    border: 2px dashed var(--wbb-border);
    box-shadow: none;
}

.wbb-select-placeholder {
    padding: 6px 12px !important;
    font-size: 12px !important;
}

/* ========================================
   FREE GOODY ANIMATION
   ======================================== */

.wbb-free-goody {
    text-align: center;
    padding: 28px;
    margin: 24px 0;
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-radius: var(--wbb-radius-lg);
    border: 2px dashed #ffa000;
}

.wbb-goody-animation {
    position: relative;
    width: 70px;
    height: 70px;
    margin: 0 auto 14px;
}

.wbb-gift-box {
    position: relative;
    width: 50px;
    height: 42px;
    margin: 18px auto 0;
}

.wbb-gift-body {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 34px;
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 100%);
    border-radius: 5px;
}

.wbb-gift-lid {
    position: absolute;
    top: 0;
    left: -4px;
    width: 58px;
    height: 12px;
    background: linear-gradient(135deg, #f06292 0%, #e91e63 100%);
    border-radius: 3px;
    animation: wbbLidBounce 2s ease-in-out infinite;
    transform-origin: center bottom;
}

.wbb-gift-ribbon {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 10px;
    height: 38px;
    background: #ffd54f;
    transform: translateX(-50%);
    border-radius: 2px;
}

.wbb-gift-ribbon::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #ffd54f;
    transform: translateX(-50%) rotate(45deg);
    border-radius: 3px;
}

@keyframes wbbLidBounce {
    0%, 100% { transform: translateY(0) rotate(0); }
    25% { transform: translateY(-10px) rotate(-6deg); }
    75% { transform: translateY(-10px) rotate(6deg); }
}

.wbb-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.wbb-sparkles span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffd54f;
    border-radius: 50%;
    animation: wbbSparkle 1.5s ease-in-out infinite;
}

.wbb-sparkles span:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.wbb-sparkles span:nth-child(2) { top: 5%; left: 80%; animation-delay: 0.2s; }
.wbb-sparkles span:nth-child(3) { top: 40%; left: 10%; animation-delay: 0.4s; }
.wbb-sparkles span:nth-child(4) { top: 35%; left: 90%; animation-delay: 0.6s; }
.wbb-sparkles span:nth-child(5) { top: 70%; left: 25%; animation-delay: 0.8s; }
.wbb-sparkles span:nth-child(6) { top: 65%; left: 75%; animation-delay: 1s; }

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

.wbb-goody-text {
    font-size: 18px;
    font-weight: 700;
    color: #e65100;
    margin: 0;
}

/* ========================================
   BUNDLE TOTAL (Fixed)
   ======================================== */

.wbb-bundle-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: var(--wbb-radius);
    margin-bottom: 20px;
    border: 2px solid var(--wbb-primary);
}

.wbb-total-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--wbb-text);
}

.wbb-total-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--wbb-primary-dark);
}

/* ========================================
   WARNING & MESSAGES
   ======================================== */

.wbb-incomplete-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--wbb-radius);
    padding: 14px 18px;
    margin-bottom: 20px;
    text-align: center;
}

.wbb-incomplete-warning p {
    margin: 0;
    color: #856404;
    font-weight: 500;
    font-size: 13px;
}

.wbb-no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--wbb-text-muted);
    background: var(--wbb-bg-alt);
    border-radius: var(--wbb-radius);
    grid-column: 1 / -1;
}

.wbb-no-results p {
    margin: 0;
    font-size: 14px;
}

/* ========================================
   ADD TO CART BUTTON
   ======================================== */

.wbb-add-to-cart {
    width: 100%;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 700;
    background: var(--wbb-primary);
    color: var(--wbb-secondary);
    border: none;
    border-radius: var(--wbb-radius);
    cursor: pointer;
    transition: var(--wbb-transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wbb-add-to-cart:hover:not(:disabled) {
    background: var(--wbb-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--wbb-shadow-lg);
}

.wbb-add-to-cart:disabled {
    background: var(--wbb-bg-dark);
    color: var(--wbb-text-muted);
    cursor: not-allowed;
}

/* ========================================
   NAVIGATION BUTTONS
   ======================================== */

.wbb-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid var(--wbb-border-light);
}

.wbb-nav-prev,
.wbb-nav-next {
    padding: 12px 28px;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--wbb-radius);
    cursor: pointer;
    transition: var(--wbb-transition);
}

.wbb-nav-prev {
    background: white;
    border: 2px solid var(--wbb-border);
    color: var(--wbb-text);
}

.wbb-nav-prev:hover {
    border-color: var(--wbb-text-light);
    background: var(--wbb-bg-alt);
}

.wbb-nav-next {
    background: var(--wbb-secondary);
    border: 2px solid var(--wbb-secondary);
    color: white;
    margin-left: auto;
}

.wbb-nav-next:hover:not(:disabled) {
    background: var(--wbb-primary);
    border-color: var(--wbb-primary);
    color: var(--wbb-secondary);
}

.wbb-nav-next:disabled {
    background: var(--wbb-bg-dark);
    border-color: var(--wbb-bg-dark);
    color: var(--wbb-text-muted);
    cursor: not-allowed;
}

/* ========================================
   CART DISPLAY STYLES
   ======================================== */

.wbb-cart-books-list {
    margin: 8px 0 0 0;
    padding: 0;
    list-style: none;
}

.wbb-cart-books-list li {
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.4;
}

.wbb-cart-books-list a {
    color: var(--wbb-text);
    text-decoration: none;
}

.wbb-cart-books-list a:hover {
    color: var(--wbb-primary-dark);
    text-decoration: underline;
}

.wbb-cart-goody-item {
    color: #388e3c !important;
    font-weight: 600;
    margin-top: 4px;
}

/* ========================================
   SHOP/CATALOG PAGE - CUSTOM PRICING LABEL
   ======================================== */

.wbb-custom-pricing {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0;
}

/* ========================================
   BOOK NOTICE ON SINGLE PRODUCT
   ======================================== */

.wbb-book-notice {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: none;
    border-radius: var(--wbb-radius-lg);
    padding: 24px;
    margin: 24px 0;
}

.wbb-book-notice p {
    margin: 0 0 16px;
    color: #1565c0;
    font-size: 14px;
}

.wbb-available-bundles strong {
    display: block;
    margin-bottom: 10px;
    color: #0d47a1;
}

.wbb-available-bundles ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wbb-available-bundles li {
    margin-bottom: 8px;
    padding: 10px 14px;
    background: white;
    border-radius: var(--wbb-radius-sm);
}

.wbb-available-bundles a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}

.wbb-available-bundles a:hover {
    text-decoration: underline;
}

/* ========================================
   ERROR/NO BOOKS MESSAGE
   ======================================== */

.wbb-no-books,
.wbb-error {
    text-align: center;
    padding: 50px 28px;
    background: var(--wbb-error-light);
    border-radius: var(--wbb-radius-lg);
    color: var(--wbb-error);
    font-weight: 500;
}

/* ========================================
   LOADING STATE
   ======================================== */

.wbb-loading {
    position: relative;
    pointer-events: none;
}

.wbb-loading::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 10;
    border-radius: var(--wbb-radius);
}

.wbb-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid var(--wbb-border);
    border-top-color: var(--wbb-primary);
    border-radius: 50%;
    animation: wbbSpin 0.7s linear infinite;
    z-index: 11;
}

@keyframes wbbSpin {
    to { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 992px) {
    .wbb-cyob-summary-bottom {
        grid-template-columns: 1fr;
    }
    
    .wbb-summary-checkout {
        order: -1;
    }
    
    .wbb-books-grid,
    .wbb-cyob-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .wbb-tabs {
        padding: 12px;
        gap: 6px;
    }
    
    .wbb-tab {
        padding: 10px 14px;
        font-size: 12px;
    }
    
    .wbb-tab-label {
        display: none;
    }
    
    .wbb-tab-review .wbb-tab-label {
        display: inline;
    }
    
    .wbb-books-grid,
    .wbb-cyob-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        max-height: 420px;
    }
    
    .wbb-book-info {
        padding: 10px;
    }
    
    .wbb-book-title {
        font-size: 12px;
        min-height: 32px;
    }
    
    .wbb-select-book {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .wbb-filter-bar {
        flex-direction: column;
        padding: 14px;
        gap: 10px;
    }
    
    .wbb-search-wrap {
        max-width: 100%;
        width: 100%;
    }
    
    .wbb-category-filter {
        width: 100%;
    }
    
    .wbb-panel-review .wbb-review-content {
        padding: 18px;
    }
    
    .wbb-bundle-total {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .wbb-builder {
        margin: 16px 0;
    }
    
    .wbb-builder-title {
        font-size: 18px;
    }
    
    .wbb-discount-badge {
        display: block;
        margin: 8px 0 0 0;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .wbb-books-grid,
    .wbb-cyob-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: 380px;
    }
    
    .wbb-navigation {
        flex-direction: column;
    }
    
    .wbb-nav-prev,
    .wbb-nav-next {
        width: 100%;
        text-align: center;
    }
    
    .wbb-nav-next {
        margin-left: 0;
    }
    
    .wbb-cyob-summary {
        padding: 16px;
    }
}

/* ========================================
   NOTICE TOAST
   ======================================== */

.wbb-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--wbb-radius);
    color: white;
    font-weight: 600;
    font-size: 13px;
    z-index: 999999;
    box-shadow: var(--wbb-shadow-lg);
    animation: wbbToastIn 0.3s ease;
    max-width: 280px;
}

.wbb-notice-success {
    background: var(--wbb-success);
}

.wbb-notice-error {
    background: var(--wbb-error);
}

@keyframes wbbToastIn {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
