/* ================= Modal Overlay ================= */
.product-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.6);
    transition: var(--transition-fast);
}

/* ================= Modal Content ================= */
.product-modal-content {
    background-color: var(--color-bg);
    margin: 50px auto;
    border-radius: var(--border-radius);
    max-width: 900px;
    width: 90%;
    max-height: 600px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn var(--transition-fast) forwards;
}

/* ================= Close Button ================= */
.product-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--color-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.product-modal-close:hover {
    color: var(--color-orangered);
}

/* ================= Modal Body ================= */
.product-modal-body {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Left side: Product Image */
.product-modal-left {
    flex: 1 1 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-modal-left img {
    max-width: 100%;
    max-height: 480px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--border-radius);
}

/* Right side: Product Info */
.product-modal-right {
    flex: 1 1 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Product Name */
.product-modal-right h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-black);
}

/* Price Styling */
.product-modal-price {
    font-size: 20px;
    font-weight: 500;
    color: var(--color-orangered);
    display: flex;
    gap: 8px;
    align-items: center;
}

.product-modal-price .original-price {
    text-decoration: line-through;
    color: var(--color-secondary);
    font-size: 16px;
}

/* Quantity Input with +/- */
.product-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--color-secondary);
    border-radius: var(--border-radius);
    background-color: var(--color-accent);
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all var(--transition-fast);
}

.qty-btn:hover {
    background-color: var(--color-orangered);
    color: var(--color-white);
}

.qty-wrapper input[type="number"] {
    width: 60px;
    text-align: center;
    padding: 6px 10px;
    border-radius: var(--border-radius);
    border: 1px solid var(--color-secondary);
    font-size: 16px;
}

/* Size Selection */
#modalSizeWrapper h4 {
    font-size: 18px;
    margin-bottom: 8px;
}

.product-size-type {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.size-type-btn {
    padding: 6px 14px;
    border: 1px solid var(--color-secondary);
    border-radius: var(--border-radius);
    background: var(--color-accent);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.size-type-btn.selected,
.size-type-btn:hover {
    background: var(--color-orangered);
    color: var(--color-white);
    border-color: var(--color-orangered);
}

/* Modal Actions */
.product-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-main {
    background-color: var(--color-orangered);
    color: var(--color-white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: background var(--transition-fast);
}

.btn-main:hover {
    background-color: var(--color-highlight);
}

.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-orangered);
    border: 2px solid var(--color-orangered);
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background-color: var(--color-orangered);
    color: var(--color-white);
}

/* ================= Responsive ================= */
@media (max-width: 768px) {
    .product-modal-body {
        flex-direction: column;
        /* Stack vertically */
        align-items: center;
        /* Center content */
    }

    .product-modal-left,
    .product-modal-right {
        /* flex: 1 1 100%; */
        /* Full width */
        max-width: 100%;
        /* Ensure no extra space */
    }

    .product-modal-left {
        margin-bottom: 20px;
        /* Space between image and details */
    }

    .product-modal-right {
        text-align: center;
        /* Optional: center text for smaller screens */
    }
}


/* ================= Animation ================= */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


.cart-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4caf50;
    color: #fff;
    padding: 12px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.cart-success-message.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}
