/* ========================================
   DICED MEAL PACKS - Bundle Builder Styles
   ======================================== */

:root {
    --diced-primary: #1B4332;
    --diced-accent: #2D6A4F;
    --diced-green-light: #D8F3DC;
    --diced-green-pale: #F0FFF4;
    --diced-highlight: #D4A017;
    --diced-red: #C62828;
    --diced-dark: #111827;
    --diced-gray: #6B7280;
    --diced-light-gray: #F3F4F6;
    --diced-border: #E5E7EB;
    --diced-white: #FFFFFF;
    --diced-radius: 12px;
    --diced-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --diced-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

#diced-bundle-builder {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Steps */
.diced-step {
    display: none;
    margin-bottom: 40px;
}
.diced-step.diced-step-active {
    display: block;
}
.diced-step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.diced-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--diced-primary);
    color: var(--diced-white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}
.diced-step-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--diced-dark);
    margin: 0;
    padding: 0;
}

/* Date Grid */
.diced-date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.diced-date-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--diced-white);
    border: 2px solid var(--diced-border);
    border-radius: var(--diced-radius);
    cursor: pointer;
    transition: all 0.2s;
}
.diced-date-btn:hover {
    border-color: var(--diced-accent);
    background: var(--diced-green-pale);
}
.diced-date-btn.selected {
    border-color: var(--diced-primary);
    background: var(--diced-green-light);
    box-shadow: var(--diced-shadow);
}
.diced-date-short {
    font-weight: 700;
    font-size: 16px;
    color: var(--diced-dark);
}
.diced-date-full {
    font-size: 13px;
    color: var(--diced-gray);
    margin-top: 4px;
}

/* Bundle Size Grid */
.diced-bundle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.diced-bundle-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--diced-white);
    border: 2px solid var(--diced-border);
    border-radius: var(--diced-radius);
    cursor: pointer;
    transition: all 0.2s;
}
.diced-bundle-btn:hover {
    border-color: var(--diced-accent);
    background: var(--diced-green-pale);
    transform: translateY(-2px);
    box-shadow: var(--diced-shadow-lg);
}
.diced-bundle-btn.selected {
    border-color: var(--diced-primary);
    background: var(--diced-green-light);
}
.diced-bundle-size {
    font-size: 36px;
    font-weight: 800;
    color: var(--diced-primary);
    line-height: 1;
}
.diced-bundle-label {
    font-size: 14px;
    color: var(--diced-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}
.diced-bundle-discount {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 10px;
    background: var(--diced-highlight);
    color: var(--diced-white);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* Specialty Bundles */
.diced-specialty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--diced-dark);
    margin: 28px 0 16px;
}
.diced-specialty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.diced-specialty-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--diced-white);
    border: 2px solid var(--diced-border);
    border-radius: var(--diced-radius);
    cursor: pointer;
    transition: all 0.2s;
}
.diced-specialty-btn:hover {
    border-color: var(--diced-accent);
    background: var(--diced-green-pale);
}
.diced-specialty-btn.selected {
    border-color: var(--diced-primary);
    background: var(--diced-green-light);
}
.diced-specialty-name {
    font-weight: 600;
    color: var(--diced-dark);
    font-size: 14px;
}
.diced-specialty-price {
    font-weight: 700;
    color: var(--diced-primary);
    font-size: 16px;
}

/* Selection Bar (Sticky) */
.diced-selection-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: var(--diced-primary);
    color: var(--diced-white);
    border-radius: var(--diced-radius);
    margin-bottom: 20px;
    box-shadow: var(--diced-shadow-lg);
    flex-wrap: wrap;
    gap: 10px;
}
.diced-selection-count {
    font-size: 16px;
    font-weight: 600;
}
.diced-selection-total {
    font-size: 15px;
}
.diced-selection-total strong {
    font-size: 20px;
}
.diced-savings-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--diced-highlight);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

/* Filters */
.diced-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--diced-border);
}
.diced-filter-btn {
    padding: 8px 16px;
    background: var(--diced-white);
    border: 1px solid var(--diced-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--diced-dark);
}
.diced-filter-btn:hover {
    background: var(--diced-green-pale);
    border-color: var(--diced-accent);
}
.diced-filter-btn.diced-filter-active {
    background: var(--diced-primary);
    color: var(--diced-white);
    border-color: var(--diced-primary);
}

/* Meals Grid */
.diced-meals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.diced-meal-card {
    position: relative;
    background: var(--diced-white);
    border: 2px solid var(--diced-border);
    border-radius: var(--diced-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}
.diced-meal-card:hover {
    border-color: var(--diced-accent);
    box-shadow: var(--diced-shadow);
    transform: translateY(-2px);
}
.diced-meal-card.diced-meal-selected {
    border-color: var(--diced-primary);
    background: var(--diced-green-pale);
    box-shadow: 0 0 0 2px var(--diced-primary);
}
.diced-meal-card.diced-meal-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
.diced-meal-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.diced-meal-info {
    padding: 12px 14px;
}
.diced-meal-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--diced-dark);
    margin-bottom: 6px;
    line-height: 1.3;
}
.diced-meal-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.diced-meal-calories {
    font-size: 13px;
    color: var(--diced-gray);
    font-weight: 500;
}
.diced-meal-price {
    font-weight: 700;
    color: var(--diced-primary);
    font-size: 15px;
}

/* Quantity badge on selected meals */
.diced-meal-qty-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--diced-primary);
    color: var(--diced-white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--diced-shadow);
}

/* Selected check overlay */
.diced-meal-check {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--diced-primary);
    color: var(--diced-white);
    border-radius: 50%;
    font-size: 16px;
}
.diced-meal-selected .diced-meal-check {
    display: flex;
}

/* Cart Actions */
.diced-cart-actions {
    text-align: center;
    padding: 20px 0;
}
.diced-add-to-cart-btn {
    display: inline-block;
    padding: 16px 48px;
    background: var(--diced-primary);
    color: var(--diced-white);
    border: none;
    border-radius: var(--diced-radius);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.diced-add-to-cart-btn:hover:not(:disabled) {
    background: var(--diced-accent);
    transform: translateY(-2px);
    box-shadow: var(--diced-shadow-lg);
}
.diced-add-to-cart-btn:disabled {
    background: var(--diced-gray);
    cursor: not-allowed;
    opacity: 0.6;
}
.diced-cart-hint {
    font-size: 14px;
    color: var(--diced-gray);
    margin-top: 10px;
}

/* Loading Overlay */
.diced-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: var(--diced-white);
    font-size: 18px;
}
.diced-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--diced-white);
    border-radius: 50%;
    animation: diced-spin 0.8s linear infinite;
    margin-bottom: 16px;
}
@keyframes diced-spin {
    to { transform: rotate(360deg); }
}

/* Success message */
.diced-success-msg {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: var(--diced-primary);
    color: var(--diced-white);
    border-radius: var(--diced-radius);
    box-shadow: var(--diced-shadow-lg);
    font-weight: 600;
    z-index: 10000;
    animation: diced-slideIn 0.3s ease;
}
@keyframes diced-slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    #diced-bundle-builder {
        padding: 10px;
    }
    .diced-step-header h2 {
        font-size: 20px;
    }
    .diced-date-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .diced-bundle-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .diced-bundle-size {
        font-size: 28px;
    }
    .diced-specialty-grid {
        grid-template-columns: 1fr;
    }
    .diced-meals-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .diced-meal-image {
        height: 130px;
    }
    .diced-meal-name {
        font-size: 13px;
    }
    .diced-selection-bar {
        flex-direction: column;
        text-align: center;
        border-radius: 0;
        margin-left: -10px;
        margin-right: -10px;
    }
    .diced-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }
    .diced-filter-btn {
        flex-shrink: 0;
    }
    .diced-add-to-cart-btn {
        width: 100%;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .diced-bundle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .diced-meals-grid {
        grid-template-columns: 1fr;
    }
    .diced-date-grid {
        grid-template-columns: 1fr;
    }
}
