/* Custom Shirt Designer Styles */

.customization-panel {
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.product-selection-panel {
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
}

/* Product Display */
.product-display-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.product-image-wrapper {
    position: relative;
    display: inline-block;
    overflow: visible;
}

/* Fixed size container for shirt images */
.shirt-image-container {
    width: 400px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Mobile responsiveness for shirt container */
@media (max-width: 768px) {
    .shirt-image-container {
        width: 100%;
        max-width: 350px;
        height: auto;
        min-height: 400px;
    }
    
    .main-product-image {
        max-width: 100%;
        max-height: 100%;
    }
}

@media (max-width: 576px) {
    .shirt-image-container {
        width: 100%;
        max-width: 300px;
        min-height: 350px;
    }
    
    .product-display-container {
        padding: 0 10px;
    }
    
    .customization-panel {
        padding: 15px;
    }
    
    .product-selection-panel {
        padding: 15px;
    }
}

.main-product-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* Upload Area */
.upload-overlay {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 90px;
    z-index: 5;
}

/* Mobile responsiveness for upload overlays */
@media (max-width: 768px) {
    .upload-overlay {
        width: 100px;
        height: 75px;
        top: 20%;
    }
    
    .upload-area {
        padding: 6px;
    }
    
    .upload-label {
        font-size: 11px;
        margin-bottom: 6px;
    }
}

@media (max-width: 576px) {
    .upload-overlay {
        width: 80px;
        height: 60px;
        top: 18%;
    }
    
    .upload-area {
        padding: 4px;
    }
    
    .upload-label {
        font-size: 10px;
        margin-bottom: 4px;
    }
}

.upload-area {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #ff0000;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #cc0000;
    transform: scale(1.05);
}

.upload-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-align: center;
}

.upload-area input[type="file"] {
    width: 100%;
    height: 100%;
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
}

/* Hide back overlay by default */
.back-overlay {
    display: none;
}

/* Show appropriate overlay based on view */
.view-thumbnail[data-view="front"]:hover ~ .front-overlay,
.view-thumbnail[data-view="back"]:hover ~ .back-overlay {
    display: block;
}

/* Dropify Customization */
.dropify-wrapper {
    background: white !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    height: 150px !important;
    width: 200px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
    position: relative !important;
    overflow: hidden !important;
}

.dropify-wrapper:hover {
    border-color: #ff0000 !important;
}

.dropify-wrapper .dropify-message {
    color: #666 !important;
    font-weight: 400 !important;
    text-align: center !important;
    padding: 60px 20px !important;
    margin: 0 !important;
    font-size: 14px !important;
    cursor: pointer !important;
}

.dropify-wrapper .dropify-message p {
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.dropify-wrapper .dropify-preview {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

.dropify-wrapper .dropify-preview .dropify-render {
    cursor: pointer !important;
}

.dropify-wrapper .dropify-preview .dropify-render img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    border-radius: 4px !important;
    cursor: pointer !important;
}

/* Hide unnecessary elements but keep file input accessible */
.dropify-wrapper .dropify-clear,
.dropify-wrapper .dropify-infos {
    display: none !important;
}

/* Make file input invisible but clickable - always on top */
.dropify-wrapper input[type="file"] {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0 !important;
    cursor: pointer !important;
    z-index: 999 !important;
}

/* Remove custom icon */
.dropify-wrapper .dropify-message::before {
    display: none !important;
}

/* Error state styling */
.dropify-wrapper.dropify-error {
    border-color: #dc3545 !important;
    background: rgba(220, 53, 69, 0.05) !important;
}

.dropify-wrapper.dropify-error .dropify-message {
    color: #dc3545 !important;
}

/* Success state styling */
.dropify-wrapper.dropify-success {
    border-color: #28a745 !important;
    background: rgba(40, 167, 69, 0.05) !important;
}

/* Uploaded Image Preview */
.uploaded-image-preview {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 150px;
    z-index: 15;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #007bff;
}

.btn-remove-image {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* View Selection */
.view-selection {
    text-align: center;
}

.view-thumbnails {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.view-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.view-thumbnail.active {
    border: 3px solid #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.thumbnail-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 5px;
}

.view-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

/* Action Buttons */
.action-buttons {
    text-align: center;
}

.btn-custom {
    margin: 0 10px;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-info {
    background: #ff0000;
    border-color: #ff0000;
}

.btn-info:hover {
    background: #cc0000;
    border-color: #cc0000;
}

.btn-outline-info {
    color: #ff0000;
    border-color: #ff0000;
}

.btn-outline-info:hover {
    background: #ff0000;
    border-color: #ff0000;
}

/* Product Selection */
.section-title {
    color: #333;
    font-weight: 700;
    text-align: center;
}

.product-carousel-container {
    margin-top: 20px;
}

/* Bootstrap Carousel Customization */
.carousel {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.carousel-inner {
    border-radius: 8px;
}

.carousel-item {
    padding: 20px;
}

.carousel-item.active {
    display: flex !important;
    justify-content: center !important;
}

/* Ensure Bootstrap Carousel Controls are Visible */
.carousel-control-prev,
.carousel-control-next {
    opacity: 1 !important;
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    border-radius: 50% !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.carousel-control-prev {
    left: 10px !important;
}

.carousel-control-next {
    right: 10px !important;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 16px !important;
    height: 16px !important;
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%) !important;
}

/* Ensure Bootstrap Carousel Indicators are Visible */
.carousel-indicators {
    margin-top: 20px !important;
}

.carousel-indicators button {
    background-color: #ccc !important;
}

.carousel-indicators button.active {
    background-color: #ff0000 !important;
}

/* Product Grid Layout */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    justify-items: center;
}

.product-item {
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    width: 100%;
    max-width: 100px;
}

.product-item:hover {
    background: rgba(255, 0, 0, 0.1);
}

.product-item.selected {
    border-color: #ff0000;
    background: rgba(255, 0, 0, 0.1);
}

.product-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 8px;
}

.product-item .product-name {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.2;
}

/* Responsive Design */
@media (max-width: 768px) {
    .col-lg-8, .col-lg-4 {
        margin-bottom: 20px;
    }
    
    .view-thumbnails {
        gap: 10px;
    }
    
    .thumbnail-image {
        width: 60px;
        height: 60px;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-item img {
        width: 60px;
        height: 60px;
    }
    
    .product-item .product-name {
        font-size: 10px;
    }
}

/* Customization Options Styling */
.color-options {
    flex-wrap: wrap;
}

.color-option {
    transition: all 0.3s ease;
    border: 2px solid #ddd;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #ff6b35;
    transform: scale(1.1);
}

.size-grid input[type="number"] {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 14px;
}

.size-grid input[type="number"]:focus {
    border-color: #ff0000;
    box-shadow: 0 0 0 0.2rem rgba(255, 0, 0, 0.25);
}

/* Always show increment/decrement arrows */
.size-grid input[type="number"]::-webkit-outer-spin-button,
.size-grid input[type="number"]::-webkit-inner-spin-button {
    opacity: 1 !important;
    display: block !important;
    height: 20px;
    margin-right: 2px;
}

.size-grid input[type="number"]::-webkit-inner-spin-button {
    margin-top: 2px;
}

/* Firefox support */
.size-grid input[type="number"] {
    -moz-appearance: textfield;
}

.size-grid input[type="number"]::-moz-number-spin-box {
    opacity: 1 !important;
}

/* Checkbox styling - Red ticks */
.form-check-input:checked {
    background-color: #ff0000 !important;
    border-color: #ff0000 !important;
}

.form-check-input:focus {
    border-color: #ff0000 !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 0, 0, 0.25) !important;
}

/* Darker text for additional information */
.text-muted {
    color: #495057 !important;
}

/* Pricing section styling */
.pricing-section {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
}

/* Add On Section Styling */
.addon-item {
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.addon-item:hover {
    border-color: #ff0000;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.1);
}

.upload-preview-container {
    position: relative;
}

.image-preview {
    position: relative;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    border: 2px solid #ff0000;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.preview-img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    display: block;
}

.btn-remove-preview {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff0000;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
}

.btn-remove-preview:hover {
    background: #cc0000;
    transform: scale(1.1);
}

#uploadDesignBtn {
    background-color: #6f42c1;
    border-color: #6f42c1;
    transition: all 0.3s ease;
}

#uploadDesignBtn:hover {
    background-color: #5a32a3;
    border-color: #5a32a3;
    transform: translateY(-2px);
}

/* Mobile Responsiveness for Add On Section */
@media (max-width: 768px) {
    .addon-item {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .addon-item .row {
        flex-direction: column;
    }
    
    .addon-item .col-md-6 {
        width: 100%;
        margin-bottom: 15px;
    }
    
    .addon-item .col-md-6:last-child {
        margin-bottom: 0;
    }
    
    .image-preview {
        max-width: 100%;
        height: 120px;
    }
    
    .preview-img {
        height: 120px;
    }
    
    .btn-remove-preview {
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: -10px;
        right: -10px;
    }
    
    /* Stack sleeve options vertically on mobile */
    .addon-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .addon-item .form-check {
        margin-bottom: 10px;
    }
    
    .addon-item .text-muted {
        margin-top: 5px;
    }
    
    /* Adjust pricing section for mobile */
    .pricing-section .row {
        flex-direction: column;
    }
    
    .pricing-section .col-md-6 {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .pricing-section .col-md-6:last-child {
        margin-bottom: 0;
    }
}

/* Extra small mobile devices */
@media (max-width: 576px) {
    .addon-item {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .image-preview {
        height: 100px;
    }
    
    .preview-img {
        height: 100px;
    }
    
    .btn-remove-preview {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    
    .addon-item .form-check-label {
        font-size: 14px;
    }
    
    .addon-item .text-muted {
        font-size: 13px;
    }
}
