/* General styling for the upload section */
.upload-content {
    padding: 40px 0;
    background: #f9f5f0;
    min-height: 100vh;
}

/* Header panel styling */
.header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.product-info {
    display: flex;
    align-items: center;
}

.back-btn {
    color: #333;
    text-decoration: none;
    margin-right: 15px;
    font-size: 20px;
    transition: color 0.3s;
}

.back-btn:hover {
    color: #f4c430;
}

.product-title {
    font-size: 24px;
    margin: 0;
    color: #333;
    font-weight: 600;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-select, .orientation-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
}

.add-to-cart-btn {
    background: #f4c430;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #e0b12a;
}

.add-to-cart-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Sidebar container */
.sidebar-container {
    background-color: rgb(245, 245, 245);
    padding: 20px;
}

/* Sidebar panel */
.sidebar-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Sidebar actions */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 15px;
    text-align: left;
    width: 100%;
    transition: all 0.3s;
}

.sidebar-btn .btn-icon {
    margin-right: 8px;
    font-size: 16px;
}

.btn-outline-secondary.sidebar-btn:hover {
    background: #52514f;
    color: #fff;
    border-color: #5f5d57;
}

.btn-warning.sidebar-btn {
    color: #fff;
    background-color: #484b48;
}

.btn-warning.sidebar-btn:hover {
    background: #3a3c3a;
}

.select-frames-icon {
    font-size: 18px;
    margin-right: 8px;
    font-weight: bold;
}

.select-mount-btn:hover:not(.disabled) {
    background: #333333 !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.select-mount-btn.disabled {
    background: #ccc !important;
    cursor: not-allowed;
}

/* Upload Image button styling */
.btn-upload {
    background: linear-gradient(135deg, #f9fafa 0%, #fdfdfd 100%);
    color: rgb(19, 18, 18);
    border: none;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    background: linear-gradient(135deg, #145257 0%, #11759c 100%);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.btn-upload .btn-icon {
    font-size: 18px;
    margin-right: 10px;
}

/* Size inputs */
.size-inputs {
    margin-top: 20px;
}

.size-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.size-inputs .form-control {
    border-radius: 4px;
    font-size: 14px;
}

.size-inputs .form-label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.size-error {
    margin-top: 10px;
    margin-bottom: 15px;
}

.save-size-btn {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* Mount selection styles */
.mount-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.mount-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.mount-option:hover {
    border-color: #f4c430;
    background: #f9f9f9;
}

.mount-option.selected {
    border-color: #f4c430;
    background: #fff9e6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-swatch {
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
}

.color-swatch[style*="transparent"] {
    background: linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd),
                linear-gradient(45deg, #ddd 25%, transparent 25%, transparent 75%, #ddd 75%, #ddd);
    background-size: 10px 10px;
    background-position: 0 0, 5px 5px;
}

.mount-option span {
    font-size: 12px;
    text-align: center;
    color: #333;
}

/* Custom size modal */
.custom-size-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.custom-size-modal.active {
    display: flex;
}

.custom-size-modal .modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.custom-size-modal h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.custom-size-modal label {
    display: block;
    font-size: 14px;
    margin: 10px 0 5px;
    color: #333;
}

.custom-size-modal input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.modal-buttons .cancel-btn,
.modal-buttons .save-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.modal-buttons .cancel-btn {
    background: #ddd;
    border: none;
    color: #333;
}

.modal-buttons .save-btn {
    background: #f4c430;
    border: none;
    color: #fff;
}

.modal-buttons .save-btn:hover {
    background: #e0b12a;
}

.error-message {
    color: red;
    font-size: 12px;
    margin-bottom: 10px;
    display: none;
}

/* Special instructions textarea */
.special-instructions textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    font-size: 14px;
}

/* Upload panel styling */
.upload-panel {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f5f0;
}

.collage-preview {
    background-color: #f9f5f0;
    margin-bottom: 20px;
}

/* Collage template base styling */
.collage-template {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgb(247, 246, 246);
    padding: 20px;
    border: 20px solid #fff;
    border-radius: 0;
    margin: 0 auto;
    display: grid;
    gap: .1px;
    width: 400px;
    height: 400px;
    position: relative;
    box-shadow:
        5px 5px 15px rgba(0, 0, 0, 0.3),
        -5px -5px 15px rgba(255, 255, 255, 0.8),
        inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.photo-slot {
    background: #f9f9f9;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Layout-specific styles */
.layout-1.collage-template {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
}

.layout-2.collage-template {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}

.layout-3.collage-template {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 2fr 1fr;
}
.layout-3 .photo-slot:nth-child(1) { grid-column: 1 / 4; grid-row: 1 / 2; }
.layout-3 .photo-slot:nth-child(2) { grid-column: 1 / 2; grid-row: 2 / 3; }
.layout-3 .photo-slot:nth-child(3) { grid-column: 2 / 3; grid-row: 2 / 3; }
.layout-3 .photo-slot:nth-child(4) { grid-column: 3 / 4; grid-row: 2 / 3; }

.layout-4.collage-template {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 2fr 1fr;
}
.layout-4 .photo-slot:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 3; }
.layout-4 .photo-slot:nth-child(2) { grid-column: 2 / 5; grid-row: 1 / 2; }
.layout-4 .photo-slot:nth-child(3) { grid-column: 2 / 3; grid-row: 2 / 3; }
.layout-4 .photo-slot:nth-child(4) { grid-column: 3 / 4; grid-row: 2 / 3; }
.layout-4 .photo-slot:nth-child(5) { grid-column: 4 / 5; grid-row: 2 / 3; }

.layout-5.collage-template {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, 1fr);
}

.layout-6.collage-template {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.layout-7.collage-template {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}
.layout-7 .photo-slot:nth-child(1) { grid-column: 1 / 2; grid-row: 1 / 3; }
.layout-7 .photo-slot:nth-child(2) { grid-column: 2 / 3; grid-row: 1 / 2; }
.layout-7 .photo-slot:nth-child(3) { grid-column: 2 / 3; grid-row: 2 / 3; }

.layout-8.collage-template {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
}

.layout-9.collage-template {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
}
.layout-9 .photo-slot:nth-child(1)  { grid-column: 1 / 2; grid-row: 1 / 2; }
.layout-9 .photo-slot:nth-child(2)  { grid-column: 2 / 3; grid-row: 1 / 2; }
.layout-9 .photo-slot:nth-child(3)  { grid-column: 3 / 4; grid-row: 1 / 2; }
.layout-9 .photo-slot:nth-child(4)  { grid-column: 4 / 5; grid-row: 1 / 2; }
.layout-9 .photo-slot:nth-child(5)  { grid-column: 2 / 4; grid-row: 2 / 4; }
.layout-9 .photo-slot:nth-child(6)  { grid-column: 1 / 2; grid-row: 2 / 3; }
.layout-9 .photo-slot:nth-child(7)  { grid-column: 1 / 2; grid-row: 3 / 4; }
.layout-9 .photo-slot:nth-child(8)  { grid-column: 4 / 5; grid-row: 2 / 3; }
.layout-9 .photo-slot:nth-child(9)  { grid-column: 4 / 5; grid-row: 3 / 4; }
.layout-9 .photo-slot:nth-child(10) { grid-column: 1 / 2; grid-row: 4 / 5; }
.layout-9 .photo-slot:nth-child(11) { grid-column: 2 / 3; grid-row: 4 / 5; }
.layout-9 .photo-slot:nth-child(12) { grid-column: 3 / 4; grid-row: 4 / 5; }
.layout-9 .photo-slot:nth-child(13) { grid-column: 4 / 5; grid-row: 4 / 5; }

/* Photo slot placeholder styling */
.photo-placeholder {
    font-size: 24px;
    color: #666;
    z-index: 1;
}

.photo-placeholder.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    50% { opacity: 0.3; }
}

/* Styling for images in photo slots */
.photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

/* Remove button for photo slots */
.photo-slot .remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    z-index: 3;
}

/* Photo preview styling */
.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.photo-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-item .remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.add-photo {
    width: 100px;
    height: 100px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #666;
    cursor: pointer;
}

.add-photo:hover {
    border-color: #f4c430;
    color: #f4c430;
}

/* Frame modal styling */
.shop-box {
    text-align: center;
    margin-bottom: 20px;
}

.image-box img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.text-section h3 {
    font-size: 16px;
    margin: 10px 0 5px;
}

.text-section p {
    font-size: 14px;
    color: #666;
}

.color-mode {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #ddd;
}

.frame-text .subtitles {
    font-size: 12px;
    color: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .header-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-actions {
        margin-top: 10px;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .collage-template {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .sidebar-container {
        margin-top: 20px;
    }
}

/* --- NEW STYLES START --- */
:root {
    --custom-highlight-color: #b3b29e;
    --custom-highlight-darker: #9c9b8a;
}

/* New Button Styles */
.btn-custom-action {
    background-color: var(--custom-highlight-color);
    border-color: var(--custom-highlight-color);
    color: #1d2019;
    font-weight: 700;
    transition: all 0.2s ease-in-out;
    padding: 12px;
    font-size: 16px;
    border-radius: .2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn-custom-action:hover, .btn-custom-action:focus {
    background-color: var(--custom-highlight-darker);
    border-color: var(--custom-highlight-darker);
    color: #212529;
    transform: translateY(-2px);
}
.btn-custom-action:disabled, .btn-custom-action[disabled] {
    background-color: #ccc !important;
    border-color: #ccc !important;
    cursor: not-allowed;
    transform: none;
    color: #6c757d;
}
/* Style for secondary/previous button to ensure consistency */
.sidebar-panel .btn-secondary,
.modal-footer .btn-secondary {
    padding: 12px;
    font-size: 16px;
    border-radius: .2rem;
}

/* Spacing for button pairs */
.d-flex.justify-content-between {
    gap: 15px;
}
/* --- NEW STYLES END --- */