/**
 * Product Modal Styles
 * Complete product detail modal system for collection pages
 */

/* ===== PRODUCT MODAL SYSTEM ===== */
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.product-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.product-modal {
    background: var(--background-white);
    border-radius: var(--radius-xl);
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(50px);
    transition: all 0.3s ease;
    position: relative;
}

.product-modal-overlay.active .product-modal {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--text-dark);
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.modal-close:hover {
    background: var(--background-white);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-header {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.modal-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-overlay-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.modal-product-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 30px 30px;
    color: var(--text-light);
}

.modal-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-title {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--heading-font);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-short-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.modal-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-section {
    margin-bottom: 30px;
}

.modal-section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-family: var(--heading-font);
    border-bottom: 2px solid var(--primary-opacity-20);
    padding-bottom: 8px;
}

.modal-section-content {
    color: var(--text-muted);
    line-height: 1.7;
    font-family: var(--default-font);
}

.modal-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.modal-benefit-card {
    background: var(--primary-opacity-5);
    border-radius: var(--radius-lg);
    padding: 20px;
    border-left: 4px solid var(--primary-color);
}

.modal-benefit-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-family: var(--heading-font);
}

.modal-benefit-description {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
    font-family: var(--default-font);
}

.modal-ingredients {
    background: var(--background-light);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 20px;
}

.modal-ingredients-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-family: var(--heading-font);
}

.modal-ingredients-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.modal-ingredient {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--background-white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.modal-ingredient-icon {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 14px;
}

.modal-ingredient-name {
    font-weight: 500;
    color: var(--text-dark);
    font-family: var(--default-font);
}

.modal-usage {
    background: var(--secondary-opacity-5);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.modal-usage-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    font-family: var(--heading-font);
}

.modal-usage-steps {
    list-style: none;
    padding: 0;
}

.modal-usage-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--background-white);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary-color);
}

.modal-usage-step-number {
    width: 25px;
    height: 25px;
    background: var(--secondary-color);
    color: var(--text-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.modal-usage-step-content {
    flex-grow: 1;
}

.modal-usage-step-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
    font-family: var(--heading-font);
}

.modal-usage-step-description {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.9rem;
    font-family: var(--default-font);
}

.modal-buy-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 30px;
    text-align: center;
    margin-top: 20px;
}

.modal-buy-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: var(--heading-font);
}

.modal-buy-description {
    margin-bottom: 20px;
    opacity: 0.9;
    font-family: var(--default-font);
}

.modal-buy-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Responsive Modal Design */
@media (max-width: 768px) {
    .product-modal-overlay {
        padding: 10px;
    }

    .modal-header {
        height: 250px;
    }

    .modal-product-info {
        padding: 30px 20px 20px;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    .modal-short-description {
        font-size: 1rem;
    }

    .modal-price {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-section-title {
        font-size: 1.2rem;
    }

    .modal-benefits-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal-ingredients-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .modal-buy-container {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .modal-header {
        height: 200px;
    }

    .modal-title {
        font-size: 1.5rem;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-buy-section {
        padding: 20px;
    }
}

/* Product Card Click Enhancement */
.product-card-clickable {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card-clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px var(--shadow-medium);
}

.product-card-clickable::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 107, 53, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: var(--radius-xl);
}

.product-card-clickable:hover::after {
    opacity: 1;
}

/* Loading State for Modal */
.modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.modal-loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Scroll Lock for Modal */
body.modal-open {
    overflow: hidden;
}
