/*
  © 2025 Eden Memory. All rights reserved.
  Unauthorized copying or distribution of this code is prohibited.
*/


/* /css/order.css */

/* ADDED STYLES FOR HEADER COLOR CHANGE */
.header-light .nav-links a,
.header-light .lang-current {
    color: #000;
}
.header-light .nav-links a:hover {
    text-shadow: none;
    opacity: 0.7;
}
.header-light .nav-swiper .swiper-slide.active-nav-link a {
    color: #000;
    opacity: 1;
    text-shadow: none;
}
.header-light .nav-swiper a {
    color: #333;
}
.header-light .lang-options .lang-btn {
    color: #333;
    text-shadow: none;
}
.header-light .lang-options .lang-btn.active {
    color: #000;
}
/* END OF ADDED STYLES */


.back-link {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.back-link:hover {
    opacity: 1;
}
.back-link-mobile {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
}

.description {
    font-size: 15px;
    color: #555;
    margin-bottom: 15px;
}

.main-info-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    align-items: flex-start;
    background: #fafafa;
    padding: 30px;
    border-radius: 2rem; /* ЗМІНЕНО */
    border: 1px solid #e0e0e0;
}

.main-photo-group label {
    font-weight: 600;
    font-size: 18px;
    display: block;
    margin-bottom: 5px;
}

#main-photo-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 2px dashed #ccc;
    border-radius: 2rem; /* ЗМІНЕНО */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

#main-photo-preview .upload-placeholder {
    color: #888;
    text-align: center;
}

#main-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#main-photo-preview .remove-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s;
    z-index: 3;
}

.date-group {
    display: flex;
    gap: 20px;
}
.date-group > div {
    flex: 1;
}

.part {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 2rem; /* ЗМІНЕНО */
    padding: 20px;
    margin-bottom: 15px;
    transition: background-color 0.3s ease;
}
.part:not(#video-part):not(#music-part) {
    cursor: grab;
}
.part:not(#video-part):not(#music-part):grabbing {
    cursor: grabbing;
}

.part.is-collapsed .photo-list,
.part.is-collapsed .part-controls,
.part.is-collapsed .music-content {
    display: none;
}

.part.is-collapsed .part-header {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.part.is-collapsed .collapse-btn svg {
    transform: rotate(-90deg);
}

.part-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.part-title-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-grow: 1;
}

.part-header input[type="text"] {
    flex-grow: 1;
    font-size: 20px;
    font-weight: 600;
    border: none;
    background: transparent;
    padding: 5px 0;
}
.part-header input.readonly-title {
    pointer-events: none;
    color: #333;
}
.part-header input[type="text"]:focus {
    outline: none;
    background: #fff;
    border-radius: 5px;
    padding-left: 5px;
    padding-right: 5px;
}

.photo-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    min-height: 50px;
}

.photo-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 1.5rem; /* ЗМІНЕНО */
    overflow: hidden;
    cursor: grab;
    transition: border-color 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.photo-item:active {
    cursor: grabbing;
}

.photo-item.sortable-selected {
    border-color: #0d6efd;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.5);
}

.photo-item .photo-order-number {
    position: absolute;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-bottom-right-radius: 1.5rem; /* ЗМІНЕНО */
    z-index: 2;
}

.photo-item img, .photo-item .preview-content {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eee;
}

.video-overlay svg {
    width: 40px;
    height: 40px;
    fill: #555;
}

.photo-item .remove-photo-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 3;
}
.photo-item:hover .remove-photo-btn {
    opacity: 1;
}

.part-controls {
    display: flex;
    gap: 10px;
    margin-left: auto;
    align-items: center;
}

.part-controls button, .part-controls .upload-btn-wrapper {
    background: #e9e9e9;
    border: none;
    border-radius: 1.5rem; /* ЗМІНЕНО */
    height: 36px;
    padding: 0 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}
.part-controls button:hover, .part-controls .upload-btn-wrapper:hover {
    background: #dcdcdc;
}

.move-part-btn {
    padding: 0;
    width: 36px;
    line-height: 1;
}

.move-part-btn svg {
    width: 20px;
    height: 20px;
}
.move-part-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #e9e9e9 !important;
}

.upload-btn-wrapper input[type="file"] {
    display: none;
}
.order-controls {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-secondary {
    color: white;
    border: 1px solid transparent;
    padding: 14px 28px;
    border-radius: 50px; /* Залишено без змін для збереження форми "пігулки" */
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    background-color: #6c757d;
}
.btn-secondary:hover {
    background-color: #5a6268;
}

.collapse-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.collapse-btn svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

#music-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.music-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 1rem; /* ЗМІНЕНО */
    font-size: 14px;
}

.music-item .remove-music-btn {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #888;
}
.music-item .remove-music-btn:hover {
    color: #333;
}

.form-container {
    max-width: 600px;
    margin: 60px auto 0;
    background: #fafafa;
    padding: 30px;
    border-radius: 2rem; /* ЗМІНЕНО */
    border: 1px solid #e0e0e0;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 1.5rem; /* ЗМІНЕНО */
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    background-color: #fff;
}
.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20256%20256%22%3E%3Cpolygon%20points%3D%22208.5%2080.5%20128%20161%2047.5%2080.5%2032%2096%20128%20192%20224%2096%20208.5%2080.5%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 12px top 50%;
    background-size: 16px auto;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    outline: none;
    border-color: #000;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.video-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 5px;
    box-sizing: border-box;
    text-align: center;
    background-color: #e9ecef;
}

.video-fallback .video-overlay {
    width: 30px;
    height: 30px;
    fill: #495057;
}

.video-fallback .file-name {
    font-size: 10px;
    color: #495057;
    margin-top: 5px;
    line-height: 1.3;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.sortable-ghost {
    opacity: 0.4;
    transform: scale(0.95);
    background: #e0e0e0;
}

.sortable-fallback {
    opacity: 1 !important;
    background: white;
    border-color: #0d6efd !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2) !important;
    cursor: grabbing !important;
    z-index: 9999;
}


@media (max-width: 767px) {
    .main-info-container {
        grid-template-columns: 1fr;
    }
    .date-group {
        flex-direction: column;
        gap: 15px;
    }

    .part-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .part-title-wrapper {
        gap: 10px;
    }

    .part-header input[type="text"] {
        text-align: left;
    }
    
    .part-controls {
        justify-content: flex-start;
        width: 100%;
        margin-left: 0;
    }

    .photo-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    .photo-item {
        width: 100%;
        height: auto;
        aspect-ratio: 1/1;
    }
    
    .photo-item .remove-photo-btn {
        opacity: 1;
    }
    
    #order-section {
        padding-top: 80px;
    }

    .main-info-container,
    .form-container {
        padding: 20px;
    }
}

.photo-item.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
    cursor: progress;
}

header .desktop-nav {
    justify-content: space-between;
}

@media (max-width: 767px) {
    header .mobile-nav {
        justify-content: space-between;
        padding: 0 20px;
    }

    .mobile-nav .dropdown-arrow {
        display: block !important;
    }
}

.is-dragging .part {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    height: 10px;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background-color: #6c757d;
    transition: width 0.1s linear;
}