/* Pack Builder — lpb.css - Black & White Theme with Full Image Display */

:root {
    --lpb-primary: #1f1f1f;
    --lpb-accent:  #979797;
    --lpb-border:  #dddddd;
    --lpb-bg:      #f5f5f5;
    --lpb-white:   #ffffff;
    --lpb-text:    #222222;
    --lpb-muted:   #777777;
    --lpb-success: #333333;
    --lpb-radius:  4px; /* Reduced border-radius */
    --lpb-shadow:  0 1px 3px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.08);
    --lpb-transition: all 0.2s ease;
}

.lpb-wrap * { 
    box-sizing: border-box; 
}

.lpb-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--lpb-text);
    max-width: 1200px; /* Increased max-width for better image display */
    margin: 0 auto 2em;
    padding: 0 15px;
}

/* Loading state */
.lpb-loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lpb-bg);
    border-radius: var(--lpb-radius);
}

/* ---- Pack selector tabs with FULL IMAGE display ---- */
.lpb-pack-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.lpb-tab {
    flex: 1 1 auto;
    min-width: 180px;
    border: 2px solid var(--lpb-border);
    border-radius: var(--lpb-radius);
    background: var(--lpb-white);
    cursor: pointer;
    transition: var(--lpb-transition);
    position: relative;
    overflow: hidden;
    padding: 0;
    height: 160px; /* Fixed height for consistency */
    display: flex;
    align-items: center;
    justify-content: center;
}

.lpb-tab:hover {
    border-color: var(--lpb-primary);
    transform: translateY(-2px);
    box-shadow: var(--lpb-shadow);
}

.lpb-tab.active {
    border-color: var(--lpb-primary);
    border-width: 2px;
    box-shadow: 0 0 0 1px rgba(31, 31, 31, 0.2);
}

/* FULL IMAGE inside tab - takes entire tab space */
.lpb-tab-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes image cover the entire area */
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.lpb-tab:hover .lpb-tab-img {
    transform: scale(1.05);
}

/* Text fallback when image is missing */
.lpb-tab-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--lpb-white);
}

.lpb-tab-pairs {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--lpb-primary);
    margin-bottom: 5px;
}

.lpb-tab-label {
    font-size: 0.85rem;
    color: var(--lpb-muted);
    margin: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lpb-tab-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--lpb-primary);
}

/* ---- Slot grid improvements ---- */
.lpb-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.lpb-slot {
    border: 2px dashed var(--lpb-border);
    border-radius: var(--lpb-radius);
    background: var(--lpb-white);
    padding: 20px 15px;
    text-align: center;
    transition: var(--lpb-transition);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.lpb-slot:hover {
    border-color: var(--lpb-accent);
    background: var(--lpb-bg);
}

.lpb-slot.filled {
    border-color: var(--lpb-primary);
    border-style: solid;
    border-width: 2px;
    background: var(--lpb-white);
}

.lpb-slot-number {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--lpb-muted);
    font-weight: 600;
}

.lpb-slot-thumb {
    width: 80px;
    height: 80px;
    border-radius: var(--lpb-radius);
    object-fit: cover;
    border: 2px solid var(--lpb-border);
    transition: var(--lpb-transition);
}

.lpb-slot.filled .lpb-slot-thumb {
    border-color: var(--lpb-primary);
}

.lpb-slot-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--lpb-text);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 5px;
}

.lpb-slot-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

.lpb-btn-choose, 
.lpb-btn-clear {
    border: none;
    border-radius: var(--lpb-radius);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--lpb-transition);
    flex: 0 1 auto;
    min-width: 85px;
}

.lpb-btn-choose { 
    background: var(--lpb-primary); 
    color: #fff; 
}

.lpb-btn-choose:hover { 
    background: #000; 
    opacity: 1;
}

.lpb-btn-clear {  
    background: #e0e0e0; 
    color: var(--lpb-text);
}

.lpb-btn-clear:hover { 
    background: #d0d0d0; 
}

.lpb-slot-placeholder {
    font-size: 0.9rem;
    color: var(--lpb-muted);
    font-style: italic;
}

/* ---- Progress bar ---- */
.lpb-progress-wrap {
    margin: 20px 0;
}

.lpb-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--lpb-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.lpb-progress-bar {
    height: 8px;
    background: var(--lpb-border);
    border-radius: 0; /* Sharp edges */
    overflow: hidden;
}

.lpb-progress-fill {
    height: 100%;
    background: var(--lpb-primary);
    border-radius: 0; /* Sharp edges */
    transition: width 0.3s ease;
}

/* ---- CTA button ---- */
.lpb-cta {
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: var(--lpb-radius);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--lpb-transition);
    margin: 20px 0;
}

.lpb-cta:enabled {
    background: var(--lpb-primary);
    color: #fff;
}

.lpb-cta:enabled:hover {
    background: #000;
}

.lpb-cta:disabled {
    background: var(--lpb-border);
    color: var(--lpb-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ---- Info bar ---- */
.lpb-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: var(--lpb-radius);
    padding: 15px 20px;
    margin: 20px 0;
    font-size: 0.95rem;
    color: var(--lpb-text);
}

.lpb-info-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* ---- Modal with minimal border-radius ---- */
.lpb-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lpb-modal {
    background: var(--lpb-white);
    border-radius: var(--lpb-radius);
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.lpb-modal-head {
    padding: 18px 24px;
    border-bottom: 2px solid var(--lpb-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lpb-modal-head h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--lpb-text);
}

.lpb-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--lpb-muted);
    line-height: 1;
    padding: 5px 10px;
    transition: var(--lpb-transition);
}

.lpb-modal-close:hover {
    color: var(--lpb-text);
}

.lpb-modal-search {
    padding: 15px 24px;
    border-bottom: 1px solid var(--lpb-border);
}

.lpb-modal-search input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--lpb-border);
    border-radius: var(--lpb-radius);
    font-size: 0.95rem;
    outline: none;
    transition: var(--lpb-transition);
}

.lpb-modal-search input:focus {
    border-color: var(--lpb-primary);
}

.lpb-modal-list {
    overflow-y: auto;
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lpb-product-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: var(--lpb-radius);
    cursor: pointer;
    transition: var(--lpb-transition);
    border: 1px solid transparent;
}

.lpb-product-row:hover {
    background: var(--lpb-bg);
    border-color: var(--lpb-border);
}

.lpb-product-row img {
    width: 60px;
    height: 60px;
    border-radius: var(--lpb-radius);
    object-fit: cover;
    border: 2px solid var(--lpb-border);
    transition: var(--lpb-transition);
}

.lpb-product-row:hover img {
    border-color: var(--lpb-primary);
}

.lpb-product-info { 
    flex: 1; 
    overflow: hidden;
}

.lpb-product-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--lpb-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.lpb-product-sku {
    font-size: 0.8rem;
    color: var(--lpb-muted);
}

.lpb-product-price {
    font-weight: 700;
    font-size: 1rem;
    color: var(--lpb-primary);
    white-space: nowrap;
    background: var(--lpb-bg);
    padding: 4px 10px;
    border-radius: var(--lpb-radius);
}

.lpb-empty-products {
    text-align: center;
    padding: 40px;
    color: var(--lpb-muted);
    font-size: 0.95rem;
}

/* ---- Toast ---- */
.lpb-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--lpb-primary);
    color: #fff;
    border-radius: var(--lpb-radius);
    padding: 14px 28px;
    font-size: 0.95rem;
    font-weight: 600;
    z-index: 100000;
    transition: transform 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lpb-toast.show {
    transform: translateX(-50%) translateY(0);
}

.lpb-toast.success { 
    background: #2c3e50; 
}

.lpb-toast.error {   
    background: #c0392b; 
}

/* ---- Loading animation ---- */
.lpb-loading::after {
    content: '...';
    animation: lpbDots 1.5s infinite;
    display: inline-block;
    width: 0;
}

@keyframes lpbDots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ---- Responsive improvements ---- */
@media (max-width: 768px) {
    .lpb-tab {
        min-width: calc(50% - 8px);
        height: 140px;
    }
    
    .lpb-pack-tabs {
        gap: 10px;
    }
    
    .lpb-slots {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .lpb-slot {
        min-height: 180px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .lpb-tab {
        min-width: 100%;
        height: 140px;
    }
    
    .lpb-slots {
        grid-template-columns: 1fr;
    }
    
    .lpb-cta {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .lpb-modal {
        max-height: 90vh;
    }
    
    .lpb-product-row {
        padding: 10px;
    }
    
    .lpb-product-row img {
        width: 50px;
        height: 50px;
    }
    
    .lpb-toast {
        font-size: 0.85rem;
        padding: 12px 20px;
        white-space: normal;
        max-width: 90%;
        text-align: center;
    }
}