/* BOGO Frontend Styles */

/* Modal Overlay */
.bogo-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bogo-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

/* Modal Container */
.bogo-modal {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.bogo-modal-overlay.active .bogo-modal {
    transform: scale(1);
}

/* Modal Close Button */
.bogo-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.2s;
}

.bogo-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Modal Header */
.bogo-modal-header {
    text-align: center;
    padding: 30px 20px 20px;
    border-bottom: 1px solid #eee;
}

.bogo-modal-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.bogo-modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #2271b1;
}

.bogo-modal-header p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Modal Body */
.bogo-modal-body {
    padding: 30px 20px;
}

.bogo-modal-instruction {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333;
}

/* Product Grid */
.bogo-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.bogo-product-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.bogo-product-card:hover {
    border-color: #2271b1;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.15);
    transform: translateY(-2px);
}

.bogo-product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.bogo-product-no-image {
    width: 100%;
    height: 150px;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    margin-bottom: 10px;
}

.bogo-product-card h4 {
    font-size: 14px;
    margin: 0 0 8px 0;
    color: #333;
    min-height: 40px;
}

.bogo-product-price {
    font-size: 16px;
    font-weight: 600;
    color: #2271b1;
    margin: 0 0 12px 0;
    text-decoration: line-through;
}

.bogo-select-product-btn {
    width: 100%;
    padding: 10px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.bogo-select-product-btn:hover {
    background: #135e96;
}

.bogo-product-card.selected {
    border-color: #28a745;
    background: #f0fff4;
}

.bogo-product-card.selected .bogo-select-product-btn {
    background: #28a745;
}

/* Modal Footer */
.bogo-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: center;
}

.bogo-modal-skip {
    padding: 10px 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.bogo-modal-skip:hover {
    background: #e0e0e0;
    color: #333;
}

/* Loading State */
.bogo-modal-loading {
    text-align: center;
    padding: 40px 20px;
}

.bogo-modal-loading:after {
    content: "Loading...";
    font-size: 16px;
    color: #2271b1;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .bogo-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .bogo-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .bogo-modal-header h2 {
        font-size: 20px;
    }
    
    .bogo-modal-icon {
        font-size: 36px;
    }
}

@media screen and (max-width: 480px) {
    .bogo-product-grid {
        grid-template-columns: 1fr;
    }
}

/* Old Cart Notification Styles (still used on cart page) */

.bogo-notification {
    border-left: 4px solid #91A3A5 !important;
    background: #f0f6fc !important;
    padding: 20px !important;
    margin-bottom: 20px;
}

.bogo-notification-content strong {
    font-size: 16px;
    color: #2271b1;
    display: block;
    margin-bottom: 8px;
}

.bogo-notification-content p {
    margin: 8px 0;
    color: #50575e;
}

.bogo-selection-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.bogo-product-select {
    flex: 1;
    max-width: 400px;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.bogo-add-button {
    padding: 10px 20px !important;
    background: #2271b1 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.bogo-add-button:hover {
    background: #135e96 !important;
    color: #fff !important;
}

.bogo-add-button:disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

.bogo-loading {
    color: #2271b1;
    font-weight: 600;
    padding: 10px 0;
}

/* Cart Item Badge */
.bogo-badge {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
    vertical-align: middle;
}

/* Success Message */
.bogo-success-message {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 15px;
    margin: 15px 0;
    border-radius: 4px;
}

/* Mobile Responsive for cart notification */
@media screen and (max-width: 768px) {
    .bogo-selection-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bogo-product-select {
        max-width: 100%;
    }
    
    .bogo-add-button {
        width: 100%;
    }
}
