/* Mix & Match Bundle Frontend Styles */

.mmb-bundle-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Main Two-Column Layout */
.mmb-main-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* Left Column: Products */
.mmb-products-section {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}

.mmb-products-section h3 {
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: left;
}

/* Right Column: Header, Slots, Summary */
.mmb-sidebar {
    flex: 0 0 400px; /* Fixed width sidebar */
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    position: sticky;
    top: 20px; /* Sticky positioning */
}

/* Mobile responsive */
@media (max-width: 768px) {
    .mmb-main-layout {
        flex-direction: column;
        gap: 20px;
    }
    
    .mmb-sidebar {
        flex: none;
        position: static;
    }
}

/* Header Styles */
.mmb-bundle-header {
    text-align: center;
    margin-bottom: 30px;
}

.mmb-bundle-header h2 {
    color: #333;
    font-size: 2.2em;
    font-weight: 700;
    margin: 0 0 8px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mmb-subtitle {
    color: #666;
    font-size: 1.1em;
    margin: 0;
}

/* Box Size Selector */
.mmb-box-size-selector {
    margin-bottom: 25px;
}

.mmb-size-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mmb-size-tab {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 140px;
    position: relative;
}

.mmb-size-tab:hover {
    border-color: #667eea;
    background: #f0f3ff;
    transform: translateY(-2px);
}

.mmb-size-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.size-number {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 4px;
}

.size-discount {
    display: block;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Bundle Status */
.mmb-bundle-status {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.mmb-progress-bar {
    background: #e9ecef;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.mmb-progress-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    transition: width 0.4s ease;
    border-radius: 4px;
}

.mmb-status-text {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.mmb-discount-message {
    color: #667eea;
    font-weight: 500;
    margin: 0;
}

/* Removed duplicate layout rules - using main layout above */

/* Bundle Grid/Slots */
.mmb-bundle-grid {
    margin-bottom: 30px;
}

.mmb-bundle-grid h3 {
    color: #333;
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.mmb-slots-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.mmb-slot {
    width: 60px;
    height: 60px;
    border: 2px dashed #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mmb-slot.filled {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-style: solid;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mmb-slot-number {
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
}

.mmb-slot.filled .mmb-slot-number {
    color: white;
}

.mmb-slot-product {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmb-slot-product img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Products Section - header styling moved to layout section above */

.mmb-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Shortcode specific styling */
.mmb-shortcode-products .mmb-products-grid {
    grid-template-columns: repeat(var(--mmb-columns, 3), 1fr);
}

.mmb-shortcode-header {
    margin-bottom: 30px;
}

.mmb-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    margin: 20px 0;
}

.mmb-product-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mmb-product-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mmb-product-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.mmb-product-image {
    position: relative;
    margin-bottom: 15px;
    text-align: center;
}

.mmb-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.mmb-selected-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #28a745;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

.mmb-product-item.selected .mmb-selected-badge {
    display: flex;
}

.mmb-product-info {
    text-align: center;
}

.mmb-product-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.mmb-product-price {
    color: #667eea;
    font-weight: 600;
    font-size: 1.1em;
    margin: 0 0 12px 0;
}

.mmb-stock-status {
    color: #666;
    font-size: 0.9em;
    margin: 0 0 15px 0;
}

/* Quantity Selector */
.mmb-quantity-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.mmb-qty-minus,
.mmb-qty-plus {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #333;
}

.mmb-qty-minus:hover:not(:disabled),
.mmb-qty-plus:hover:not(:disabled) {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.mmb-qty-minus:disabled,
.mmb-qty-plus:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mmb-qty-input {
    width: 60px;
    height: 36px;
    text-align: center;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-weight: 600;
    color: #333;
}

.mmb-qty-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Category Filters */
.mmb-category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.mmb-category-filter {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 10px 24px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.mmb-category-filter:hover {
    border-color: #667eea;
    background: #f0f3ff;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.mmb-category-filter.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mmb-category-filter.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Mobile responsive for filters */
@media (max-width: 768px) {
    .mmb-category-filters {
        gap: 8px;
    }

    .mmb-category-filter {
        padding: 8px 18px;
        font-size: 0.9em;
    }
}

/* Weekly Navigation */
.mmb-week-navigation {
    margin-bottom: 30px;
}

.mmb-week-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.mmb-week-tab {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 120px;
}

.mmb-week-tab:hover {
    border-color: #667eea;
    background: #f0f3ff;
    transform: translateY(-2px);
}

.mmb-week-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.mmb-week-tab.completed {
    border-color: #28a745;
    background: #d4edda;
}

.mmb-week-tab.active.completed {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.week-label {
    font-weight: 600;
    font-size: 1.1em;
}

.week-count {
    font-size: 0.9em;
    opacity: 0.8;
}

.mmb-week-tab.active .week-count {
    opacity: 1;
}

.week-status-icon {
    display: none;
    font-size: 1.2em;
}

.mmb-week-tab.completed .week-status-icon {
    display: inline;
}

.mmb-week-tab.completed .week-status-icon::before {
    content: '✓';
    color: #28a745;
}

.mmb-week-tab.active.completed .week-status-icon::before {
    color: white;
}

.mmb-week-info {
    margin-bottom: 20px;
    text-align: center;
}

.mmb-week-info h3 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: #333;
    margin: 0;
}

.mmb-current-week-title {
    font-size: 1.4em;
    font-weight: 600;
}

.mmb-week-subtitle {
    font-size: 1em;
    font-weight: 400;
    color: #666;
}

/* Weekly Overview Sidebar */
.mmb-weekly-overview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.mmb-weekly-overview h4 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.mmb-weeks-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mmb-week-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mmb-week-summary.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.mmb-week-summary.completed {
    border-color: #28a745;
    background: #d4edda;
}

.week-name {
    font-weight: 600;
    color: #333;
}

.week-progress {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.week-check {
    color: #28a745;
    font-weight: bold;
    font-size: 1.2em;
    display: none;
}

.mmb-week-summary.completed .week-check {
    display: inline;
}

/* Bundle Summary */
.mmb-bundle-summary {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.mmb-price-breakdown {
    margin-bottom: 20px;
}

.mmb-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.mmb-price-row:last-child {
    border-bottom: none;
}

.mmb-total-row {
    font-size: 1.2em;
    font-weight: 700;
    color: #333;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #e9ecef;
}

.mmb-discount-row {
    color: #28a745;
    font-weight: 600;
}

/* Add to Cart Button */
.mmb-add-bundle-button {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.mmb-add-bundle-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.mmb-add-bundle-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Validation Messages */
.mmb-validation-messages {
    margin-bottom: 15px;
}

.mmb-error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    margin: 0 0 10px 0;
    border: 1px solid #f5c6cb;
}

.mmb-errors {
    margin-bottom: 15px;
}

/* Bundle Contents in Cart */
.mmb-bundle-contents {
    margin-top: 10px;
}

.mmb-toggle-bundle-details {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
}

.mmb-toggle-bundle-details:hover {
    text-decoration: underline;
}

.mmb-bundle-details {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 10px;
    margin-top: 8px;
}

.mmb-bundle-details ul {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}

.mmb-bundle-details li {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 4px;
}

.mmb-savings {
    color: #28a745;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mmb-bundle-container {
        padding: 20px;
        margin: 10px 0;
    }

    .mmb-bundle-header h2 {
        font-size: 1.8em;
    }

    /* Weekly navigation mobile */
    .mmb-week-tabs {
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    .mmb-week-tab {
        flex-shrink: 0;
        scroll-snap-align: start;
        min-width: 100px;
    }

    .mmb-size-tabs {
        flex-direction: column;
        align-items: center;
    }

    .mmb-size-tab {
        width: 100%;
        max-width: 200px;
    }
    
    /* Stack layout on mobile */
    .mmb-main-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .mmb-sidebar {
        position: static;
        order: -1; /* Show bundle summary first on mobile */
    }
    
    .mmb-products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .mmb-slots-container {
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
        gap: 8px;
        max-width: 100%;
    }
    
    .mmb-slot {
        width: 50px;
        height: 50px;
    }
    
    .mmb-slot-product img {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .mmb-bundle-container {
        padding: 15px;
    }
    
    .mmb-bundle-header h2 {
        font-size: 1.5em;
    }
    
    .mmb-product-item {
        padding: 15px;
    }
    
    .mmb-bundle-summary {
        padding: 20px;
    }
    
    .mmb-price-row {
        font-size: 0.9em;
    }
    
    .mmb-total-row {
        font-size: 1.1em;
    }
}