/* Product Modal Styles */
.product-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.product-modal-content {
    background: white;
    width: 90%;
    max-width: 900px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    z-index: 10;
    transition: color 0.3s;
}

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

.modal-body-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-image-col {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-image-col img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.modal-info-col {
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.modal-info-col h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.modal-price-box {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.modal-price-box .current-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
}

.modal-price-box .old-price {
    font-size: 1.2rem;
    color: #999;
    text-decoration: line-through;
}

.modal-description {
    color: #555;
    line-height: 1.7;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
    align-items: center;
}

.qty-control {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.qty-control button {
    background: #f8f9fa;
    border: none;
    width: 40px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s;
}

.qty-control button:hover {
    background: #e9ecef;
}

.qty-control input {
    width: 50px;
    border: none;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    -moz-appearance: textfield;
    appearance: textfield;
}

.qty-control input::-webkit-outer-spin-button,
.qty-control input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.modal-actions .btn-primary {
    padding: 0 2rem;
    height: 45px;
    font-size: 1.1rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

.modal-actions .btn-primary:hover {
    background: var(--secondary-color);
}

.modal-meta {
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
}

.modal-meta p {
    margin-bottom: 0.5rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-body-grid {
        grid-template-columns: 1fr;
        /* Stack vertically */
        display: flex;
        flex-direction: column;
    }

    .modal-image-col {
        padding: 1rem;
        width: 100%;
        background: #fff;
        /* Cleaner look on mobile */
        border-bottom: 1px solid #f0f0f0;
        flex-shrink: 0;
        /* Prevent squishing */
    }

    .modal-image-col img {
        max-height: 250px;
        /* Limit height on mobile */
        width: auto;
        /* Maintain aspect ratio */
        max-width: 100%;
    }

    .modal-info-col {
        padding: 1.5rem;
        overflow-y: auto;
        /* Allow text to scroll independently if needed */
    }

    .modal-info-col h2 {
        font-size: 1.4rem;
        margin-top: 0;
    }

    .modal-price-box .current-price {
        font-size: 1.6rem;
    }

    /* Adjust Close Button */
    .modal-close {
        top: 10px;
        right: 10px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        width: 35px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
    }
}

/* New Ribbon Image Styles */
.top-banner-image {
    width: 100%;
    position: relative;
    z-index: 1001;
    /* Above header */
}

.top-banner-image img {
    /* Ensure responsiveness */
    width: 100%;
    height: auto;
    max-height: 120px;
    /* Limit height so it doesn't take too much space */
    object-fit: contain;
    /* Or cover depending on pref, usually contain for banners */
}

/* Product Card - New Qty Input */
.product-card input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.product-card input[type="number"]::-webkit-outer-spin-button,
.product-card input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Responsive Button Text */
@media (max-width: 400px) {
    .btn-text-responsive {
        display: none;
    }
}