/* Single Product View Styles */
.single-product-section {
    padding: 8rem 5% 5rem;
    /* Adjust padding below sticky header */
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
}

.single-product-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1200px;
    width: 100%;
    align-items: center;
}

@media (max-width: 900px) {
    .single-product-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Product Visual */
.product-visual {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.main-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    /* Keep square or match image aspect */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Mask the zoomed image */
    cursor: zoom-in;
}

.sold-out-badge-large {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary-color, #ef4444);
    color: white;
    font-family: var(--font-heading, sans-serif);
    font-size: 1.2rem;
    padding: 0.5rem 1.2rem;
    border-radius: 4px;
    z-index: 5;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    /* Let clicks pass through to image for zoom if needed */
}

.main-image-wrapper img {
    width: 100%;
    height: 100%;
    /* Ensure it fills container for correct coordinates */
    object-fit: contain;
    transition: transform 0.1s ease-out;
    /* Fast response for mousemove tracking */
    transform-origin: center center;
    will-change: transform;
    /* Performance optimization */
}

/* 
   Hover effect is now handled by JS to ensure 
   transform-origin and scale happen in sync 
*/

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    /* Flex when loading */
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(5px);
    border-radius: 12px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Product Details */
.product-details-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1;
    color: var(--text-color);
}

.product-price {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--accent-color);
}

.product-description {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    max-width: 400px;
}

.product-description span {
    color: var(--white);
    font-weight: 600;
}

/* Selection Group */
.selection-group {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    /* For dropdown positioning */
}

.selection-group label {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: var(--text-color);
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.country-search-input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.country-search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}

.country-select-hidden {
    display: none;
    /* Use custom search input instead */
}

.search-results-dropdown {
    position: absolute;
    top: 105%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    z-index: 100;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.search-result-item {
    padding: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Action Group */
.action-group {
    margin-top: 1rem;
}

.add-to-cart-btn {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
    background: var(--accent-color);
    color: var(--black);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    background: #fff;
    /* White feedback on hover */
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* Shake Animation for No Selection */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s;
    border-color: #ff4444;
}