/* Container for the main content to center it and add padding */
.stock-item-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}
/* Main Layout: Image and Details Side-by-Side (Desktop) */
.stock-detail-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Image column narrower than info column */
    gap: 40px;
}
/* Image Column */
.stock-image-col {
    position: relative;
}
.stock-image-wrapper-detail {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}
.stock-item-container img {
    max-width: 100%;
    height: auto;
    max-height: 500px; /* Limit max height */
    object-fit: cover;
    border-radius: 8px;
    display: block;
    transition: filter 0.3s ease;
}
.stock-image-wrapper-detail:has(.sold-out-overlay-detail) img {
    filter: brightness(50%) grayscale(50%);
}
.sold-out-overlay-detail {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-10deg); /* Center and tilt */
    padding: 10px 30px;
    background-color: rgba(220, 53, 69, 0.8); /* Darker red */
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    border: 4px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    z-index: 10;
}
/* Info Column */
.stock-info-col h1 {
    color: var(--color-sapphire-blue, #004D99);
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 20px;
}
/* Detail Groups (Gem Type, Status, Price) */
.info-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 1.1em;
}
.detail-label {
    margin-bottom: 0;
    font-weight: 500;
    color: #555;
}
.detail-value {
    margin-bottom: 0;
    font-weight: 600;
    text-align: right;
    color: var(--color-text-dark, #222);
}
.price-group {
    border-top: 2px solid var(--color-secondary-light, #eee);
    margin-top: 15px;
    padding-top: 15px;
}
.price-group .price {
    font-size: 1.6em;
    color: var(--color-accent-gold, #D4AF37);
    font-weight: 700;
}
/* Description Section */
.description-section {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}
.description-section h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: var(--color-sapphire-blue, #004D99);
}
.description-section p {
    font-size: 1em;
    line-height: 1.6;
    color: #555;
}
/* Action Button */
.action-buttons {
    margin-top: 30px;
}
.btn-checkout { /* Corrected class name */
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
}

.btn-back-to-list {
    margin-bottom: 25px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 1em;
    padding: 8px 15px;
    border: 1px solid var(--color-text-fade-dark, #555);
    color: var(--color-text-fade-dark, #555);
    background-color: transparent;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.btn-back-to-list:hover {
    background-color: var(--color-secondary-light, #eee);
    color: var(--color-text-dark, #222);
}
.zoomable-image{
    cursor: zoom-in;
    max-width:100%;
}

/* Modal */

.lux-modal{
    display:none;
    position:fixed;
    z-index:3000;
    inset:0;
    background:#0a0a0a;
}

.lux-toolbar{
    position:absolute;
    top:20px;
    right:30px;
    color:white;
    font-size:28px;
    z-index:10;
    cursor:pointer;
}

/* Viewer stage */

#viewerStage{
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
}

#viewerImage{
    max-width:92%;
    max-height:92%;
    transform-origin:center;
    transition:transform 0.15s ease-out;
    cursor:grab;
}
/* --- RESPONSIVENESS (Mobile View) --- */
@media (max-width: 900px) {
    .stock-item-container {
        max-width: 90%;
        margin: 20px auto;
        padding: 20px;
    }
}
@media (max-width: 768px) {
    /* Switch to single column layout */
    .stock-detail-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .stock-info-col h1 {
        font-size: 2em;
        text-align: center;
        margin-bottom: 10px;
    }
    .stock-image-col img {
        max-height: 400px;
    }
    /* Back button takes full width and centers */
    .btn-back-to-list {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 30px;
    }
    .description-section h2 {
        font-size: 1.5em;
    }
    .info-group, .description-section p {
        font-size: 1em;
    }
}
@media (max-width: 480px) {
    /* Remove padding/margin on container for edge-to-edge feel */
    .stock-item-container {
        padding: 15px;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .stock-image-col img {
        max-height: 300px;
    }
    .stock-info-col h1 {
        font-size: 1.8em;
    }
    .price-group .price {
        font-size: 1.4em;
    }
    .btn-checkout { /* Corrected class name */
        padding: 12px;
        font-size: 1.1em;
    }
    .sold-out-overlay-detail {
        font-size: 1.4em;
        padding: 8px 20px;
    }
}