/* ================================================== */
/* PRODUCT DETAIL MODAL - Hazlnut style               */
/* Inspired by contribution modal                     */
/* ================================================== */

.product-detail-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-detail-modal-overlay.active {
    display: flex;
}

.product-detail-modal-container {
    background: #f2efec;
    border-top: 2px solid #b2b2b2;
    border-radius: 22px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    padding: 35px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.product-detail-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    background: #324848;
    border: 1px solid #2a3a3a;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    line-height: 1;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.product-detail-modal-close:hover {
    background: #2a3a3a;
    color: white;
    border-color: #243333;
}

.product-detail-modal-content {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 36px;
}

/* Left Column */
.product-detail-left-column {
    display: flex;
    flex-direction: column;
}

.product-detail-image-wrapper {
    position: relative;
    width: 100%;
    max-height: 320px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #e3dcd6;
}

.product-detail-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Right Column */
.product-detail-right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-right: 52px; /* Clear space for close button */
    min-width: 0; /* Allow flex to shrink */
    text-align: left;
}

.product-detail-info {
    margin-bottom: 0;
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.product-detail-title {
    font-family: 'Work Sans', sans-serif;
    font-weight: 500;
    font-size: 22px;
    color: #262e2e;
    letter-spacing: -0.48px;
    margin: 0 0 8px 0;
    padding: 0;
    line-height: 1.35;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.product-detail-price {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #262e2e;
    margin: 0;
    padding: 0;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

/* Action Buttons */
.product-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
}

.product-detail-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: #E1B672;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.product-detail-add-btn:hover {
    background: #D4A85F;
}

.product-detail-add-btn i {
    font-size: 14px;
}

.product-detail-brand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 8px;
    font-family: 'Work Sans', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: white;
    background: #324848;
    border: 1px solid #2a3a3a;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.product-detail-brand-btn:hover {
    background: #2a3a3a;
    border-color: #243333;
}

.product-detail-brand-btn-icon {
    display: inline-flex;
    align-items: center;
}

.product-detail-brand-btn-icon img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

.product-detail-brand-btn-text {
    flex: 1;
    text-align: left;
    color: white;
}

.product-detail-brand-btn-price {
    font-weight: 600;
    color: #E1B672;
}

.product-detail-brand-btn i {
    font-size: 12px;
    color: white;
}

/* Mobile */
@media (max-width: 640px) {
    .product-detail-modal-container {
        padding: 24px 20px;
        max-height: 90vh;
        max-width: 100%;
    }

    .product-detail-modal-close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 16px;
    }

    .product-detail-modal-content {
        grid-template-columns: 1fr;
        gap: 24px;
        align-items: start;
        justify-items: start;
    }

    .product-detail-left-column {
        align-items: flex-start;
        width: 100%;
    }

    .product-detail-right-column {
        padding-right: 0;
        padding-left: 0;
        align-items: stretch;
        text-align: left;
        width: 100%;
        max-width: 100%;
    }

    .product-detail-info {
        text-align: left;
        width: 100%;
    }

    .product-detail-title {
        font-size: 18px;
        text-align: left;
        padding: 0; /* Override global h2 padding from style.css */
    }

    .product-detail-price {
        font-size: 18px;
        text-align: left;
        padding: 0;
    }

    .product-detail-actions {
        align-items: stretch;
        width: 100%;
        max-width: 100%;
    }

    /* Image at natural size - no card constraint */
    .product-detail-image-wrapper {
        max-height: none;
        border-radius: 0;
        overflow: visible;
        background: transparent;
        margin: 0;
        display: block;
    }

    .product-detail-image {
        width: auto;
        max-width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
        margin: 0;
    }

    .product-detail-add-btn,
    .product-detail-brand-btn {
        padding: 12px 18px;
        font-size: 15px;
    }
}
