/* Product Detail Modal */
.product-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.product-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(255, 107, 139, 0.3);
    animation: slideDown 0.4s ease;
    position: relative;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: all 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: var(--primary);
    transform: scale(1.2);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Image Carousel */
.image-carousel {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.carousel-main {
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5, #efefef);
    position: relative;
}

.carousel-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: fadeInImage 0.5s ease;
}

@keyframes fadeInImage {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.carousel-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
}

.carousel-btn {
    background: linear-gradient(135deg, var(--primary), #ff8fa3);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 139, 0.3);
}

.carousel-counter {
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
}

.carousel-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 15px;
    background: #f9f9f9;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 107, 139, 0.4);
}

.auto-rotate-indicator {
    font-size: 0.8rem;
    color: #999;
    text-align: center;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
    margin-top: 10px;
}

.auto-rotate-indicator .spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ddd;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Product Details */
.product-details {
    display: flex;
    flex-direction: column;
}

.details-header {
    margin-bottom: 20px;
}

.product-modal h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
}

.product-modal .modal-price {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: bold;
    background: linear-gradient(90deg, #ff6b8b, #ffd166);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.stars {
    color: #ffc107;
    font-size: 1.1rem;
}

.rating-text {
    color: #666;
    font-size: 0.9rem;
}

.product-modal .stock-info {
    padding: 15px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(144, 238, 144, 0.2), rgba(144, 238, 144, 0.1));
    border-left: 4px solid #90ee90;
    margin-bottom: 20px;
}

.stock-info.low-stock {
    background: linear-gradient(135deg, rgba(255, 107, 139, 0.2), rgba(255, 107, 139, 0.1));
    border-left-color: var(--primary);
}

.stock-info p {
    margin: 0;
    color: #333;
    font-weight: 500;
}

.product-modal .description {
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1rem;
}

.product-modal .specifications {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.specifications h4 {
    color: #333;
    margin-bottom: 15px;
    font-weight: 700;
}

.spec-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    color: #666;
    font-size: 0.95rem;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 600;
    color: #333;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.quantity-selector label {
    font-weight: 600;
    color: #333;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-control button {
    background: white;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.quantity-control button:hover {
    background: #f0f0f0;
}

.quantity-control input {
    border: none;
    width: 50px;
    text-align: center;
    padding: 8px;
    font-weight: 600;
}

.product-modal .action-buttons {
    display: flex;
    gap: 15px;
    margin-top: auto;
}

.product-modal .btn-primary {
    flex: 1;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), #ff8fa3);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-modal .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 107, 139, 0.3);
}

.product-modal .btn-secondary {
    flex: 1;
    padding: 15px;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-modal .btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .modal-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .carousel-main {
        height: 300px;
    }

    .product-modal h2 {
        font-size: 1.5rem;
    }

    .product-modal .modal-price {
        font-size: 1.5rem;
    }

    .carousel-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }

    .action-buttons {
        flex-direction: column;
    }
}
