/* Container styles */
.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    text-align: left;
    border-style: dotted;
    border-color: #b70e13;
    border-radius: 10px;
    box-sizing: border-box;
}

.fixed-preview-container {
    width: 400px;
    height: 400px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Starting fee info box */
.starting-fee-info {
    background-color: #f8f4e5;
    border: 1px solid #e0d5b0;
    border-left: 4px solid #B70E13;
    padding: 12px 15px;
    margin: 15px 0;
    border-radius: 3px;
    font-size: 15px;
    color: #333;
}

.starting-fee-info strong {
    color: #B70E13;
}

/* Upload button */
.upload-btn-container {
    text-align: center;
    margin: 30px 0;
}

.button-single {
    margin: 10px auto;
    padding: 12px 25px;
    background-color: #B70E13;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Kaleko205Round', Arial, sans-serif;
    font-size: 16px;
    transition: background-color 0.2s;
    display: block;
}

.button-single:hover {
    background-color: #960b0f;
}

/* Image carousel */
.image-carousel {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    text-align: center;
}

.crop-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 400px;
    max-height: 400px;
}

#currentImage {
    max-width: 400px;
    max-height: 400px;
    display: block;
    margin: 0 auto;
    width: auto;
    height: auto;
}

.crop-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 0, 0, 0.5);
    z-index: 1;
}

.crop-window {
    position: absolute;
    border: 2px dashed #B70E13;
    background-color: transparent;
    z-index: 2;
    cursor: move;
    user-select: none;
}

/* Resize handles för crop-fönstret */
.resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: white;
    border: 2px solid #B70E13;
    border-radius: 50%;
    z-index: 3;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.resize-nw {
    top: -6px;
    left: -6px;
    cursor: nw-resize;
}

.resize-ne {
    top: -6px;
    right: -6px;
    cursor: ne-resize;
}

.resize-se {
    bottom: -6px;
    right: -6px;
    cursor: se-resize;
}

.resize-sw {
    bottom: -6px;
    left: -6px;
    cursor: sw-resize;
}

/* Navigation arrows */
.carousel-nav {
    display: flex;
    justify-content: space-between;
    margin: 15px auto;
    max-width: 360px;
}

.carousel-nav button {
    padding: 10px 20px;
    background-color: #B70E13;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Kaleko205Round', Arial, sans-serif;
    width: 160px; /* Set a fixed width for both buttons */
    text-align: center;
}

.carousel-nav button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Size selection */
.size-selection {
    margin: 20px 0;
    display: block; /* Changed from grid to block for the dropdown */
}

/* CSS för att placera knappen bredvid dropdown */
.size-dropdown-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.size-dropdown {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Kaleko205Round', Arial, sans-serif;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.size-dropdown:focus {
    outline: none;
    border-color: #B70E13;
    box-shadow: 0 0 5px rgba(183, 14, 19, 0.3);
}

.size-dropdown option {
    padding: 10px;
}

/* Svart/vit-knapp stil */
.bw-toggle-btn {
    padding: 12px 15px;
    background-color: #B70E13;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Kaleko205Round', Arial, sans-serif;
    font-size: 16px;
    transition: background-color 0.2s;
    white-space: nowrap;
    width: 130px; /* Fast bredd på 130px för att matcha navigeringsknapparna */
    text-align: center; /* Centrera texten i knappen */
}

.bw-toggle-btn:hover {
    background-color: #960b0f;
}

.bw-toggle-btn.active {
    background-color: #333;
}

.bw-toggle-btn.active:hover {
    background-color: #555;
}

/* Svart/vit-effekt för bilder */
.grayscale-filter {
    filter: grayscale(100%);
}

/* Orientation indicator */
.orientation-indicator {
    display: inline-block;
    margin-left: 10px;
    padding: 5px 10px;
    background-color: #f0f0f0;
    border-radius: 3px;
    font-size: 14px;
}

/* Current size indicator */
.current-size {
    margin-top: 10px;
    padding: 8px;
    background-color: #f9f9f9;
    border-radius: 5px;
    font-size: 16px;
    text-align: center;
}

.current-size span {
    font-weight: bold;
    color: #B70E13;
}

/* Button group */
.button-group {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    margin: 20px 0;
}

/* Gemensam stil för alla knappar */
.button-group button {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Kaleko205Round', Arial, sans-serif;
    transition: all 0.2s;
    color: white;
}

/* Stil för orienteringsknappen */
.orientation-btn {
    background-color: #B70E13;
}

.orientation-btn:hover {
    background-color: #960b0f;
}

/* Stil för toggle-knappen */
.toggle-image-btn {
    background-color: #B70E13;
}

.toggle-image-btn:hover {
    background-color: #960b0f;
}

.toggle-image-btn.exclude {
    background-color: #666;
}

.toggle-image-btn.exclude:hover {
    background-color: #555;
}

/* Stil för reset-knappen */
.reset-session-btn {
    background-color: #444;
}

.reset-session-btn:hover {
    background-color: #333;
}

/* Excluded image style */
.image-excluded::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><line x1="10" y1="10" x2="90" y2="90" stroke="red" stroke-width="8"/><line x1="90" y1="10" x2="10" y2="90" stroke="red" stroke-width="8"/></svg>') no-repeat center center;
    background-size: 80% 80%;
    pointer-events: none;
    z-index: 3;
}

/* Price summary */
.price-summary {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* Style for the starting fee to make it more noticeable */
.starting-fee {
    font-weight: bold;
    background-color: #f5f5f5;
    padding: 8px 5px;
    border-radius: 3px;
    margin: 8px 0;
    border-bottom: 1px solid #ddd;
}

.price-total {
    font-weight: bold;
    border-top: 2px solid #ddd;
    padding-top: 10px;
    margin-top: 10px;
}

.price {
    color: #000;
    font-weight: bold;
}

/* Add to cart button */
.add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #B70E13;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    font-family: 'Kaleko205Round', Arial, sans-serif;
    margin-top: 20px;
    transition: background-color 0.2s;
}

.add-to-cart-btn:hover {
    background-color: #960b0f;
}

/* Thumbnail preview */
.thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    justify-content: center;
}

.thumbnail {
    width: auto;
    height: 80px;
    max-width: none;
    flex: 0 0 auto;
    border: 2px solid #ddd;
    border-radius: 5px 5px 0 0; /* Round only the top corners */
    overflow: visible; /* Allow content to overflow for the label */
    position: relative;
    cursor: pointer;
    margin-bottom: 24px; /* Add space for the size indicator */
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.active {
    border-color: #B70E13;
}

.thumbnail.excluded {
    opacity: 0.6;
}

.thumbnail-size {
    position: absolute;
    bottom: 6px; /* Position it below the thumbnail instead of at bottom */
    left: 0;
    right: 0;
    color: black;
    font-size: 12px;
    text-align: center;
    padding: 2px;
    width: 98%;
}

.thumbnail-excluded {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px; /* Match the height of the thumbnail */
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><line x1="10" y1="10" x2="90" y2="90" stroke="red" stroke-width="4"/><line x1="90" y1="10" x2="10" y2="90" stroke="red" stroke-width="4"/></svg>') no-repeat center center;
    background-size: 60% 60%;
}

/* Loading indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-indicator span {
    background-color: #fff;
    color: #B70E13;
    padding: 15px 20px;
    border-radius: 5px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Responsiv stil för mindre skärmar */
@media (max-width: 600px) {
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .size-dropdown-container {
        flex-direction: column;
        align-items: stretch;
    }
   
    .bw-toggle-btn {
        width: 100%; /* Anpassa bredden till 100% på mindre skärmar */
        margin-top: 5px;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    .thumbnail {
        width: auto;
        height: 60px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .carousel-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    .carousel-nav button {
        width: 100%;
    }
}