/* General styling for the upload section */
.upload-content {
    padding: 0px 0;
    background: #ffffff;
}

.section{
    margin: 0px 0px 0px 0px!important;
}

/* 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: 2px;
}

.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(255, 255, 255);
    padding: 20px;
}

/* Sidebar panel */
.sidebar-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0);
    padding: 20px;
}

/* Sidebar actions */
.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    text-align: center;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 15px;
    text-align: center;
    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: 1px solid #000000;
    border-radius: 6px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-upload:hover {
    background: linear-gradient(135deg, #f9aa2e 0%, #f9aa2e 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;
    border-radius: 10px;
    padding: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.custom-size-modal h3 {
    font-size: 20px;
    margin-bottom: 15px;
    text-align: center;
    color: #333;
}

.custom-size-modal label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #516b86;
}

.custom-size-modal input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.custom-size-modal input[type="number"] {
    -moz-appearance: textfield;
}

.custom-size-modal input::-webkit-outer-spin-button,
.custom-size-modal input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.modal-buttons button {
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-buttons .save-btn,
.apply-border-button {
    background: #000;
    color: #fff;
    border: none;
}

.modal-buttons .save-btn:hover,
.apply-border-button:hover {
    background: #333;
}

.modal-buttons .cancel-btn {
    background: #f5f5f5;
    border: 1px solid #ccc;
    color: #333;
}

.modal-buttons .cancel-btn:hover {
    background: #e0e0e0;
}

.error-message {
    color: #e63946;
    font-size: 12px;
    margin-bottom: 10px;
    display: none;
    text-align: center;
}

/* 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: #ffffff;
}

.collage-preview {
    background-color: #ffffff;
    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: 0px solid #fff;
    border-radius: 0;
    margin: 0 auto;
    display: grid;
    gap: .1px;
    width: 400px;
    height: 400px;
    position: relative;
    
}

.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: normal!important;
    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;
}

.btn-secondary{
    background-color: #ffffff;
    color: #000000;
}


.btn-secondary:hover{
    background-color: #000000;
    color: #ffffff;
}
/* Spacing for button pairs */
.d-flex.justify-content-between {
    gap: 15px;
}

/* Mount Border Size Modal - Updated Styling */
.mount-border-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.mount-border-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 25px;
    color: #333;
    width: 100%;
}

.mount-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.mount-input-label {
    font-size: 15px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
    text-align: center;
    width: 100%;
}

.mount-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.mount-size-input {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 15px;
    text-align: center;
    font-weight: 500;
    height: 36px;
    box-sizing: border-box;
}

.mount-input-addon {
    padding: 8px 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-left: none;
    border-radius: 0 4px 4px 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    height: 36px;
    display: flex;
    align-items: center;
}

.center-preview-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 25px 0;
    width: 100%;
}

.mount-side-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.mount-side-input.left {
    margin-right: 20px;
}

.mount-side-input.right {
    margin-left: 20px;
}

.preview-box-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-box-outer {
    width: 140px;
    height: 140px;
    border: 2px solid #333;
    background-color: #f0f0f0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.preview-box-inner {
    width: 90px;
    height: 90px;
    border: 2px solid #0066cc;
    background-color: #fff;
    border-radius: 2px;
}

.apply-border-button-container {
    text-align: center;
    margin-top: 25px;
    width: 100%;
}

.apply-border-button {
    background-color: #000;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-weight: 500;
    min-width: 180px;
}

.apply-border-button:hover {
    background-color: #333;
}

/* Responsive adjustments for mount size modal */
@media (max-width: 768px) {
    .center-preview-section {
        flex-direction: column;
        gap: 20px;
    }

    .mount-side-input {
        width: 100%;
        text-align: center;
        margin: 0;
    }

    .mount-side-input.left, .mount-side-input.right {
        margin: 0;
    }

    .preview-box-wrapper {
        order: -1;
        margin-bottom: 20px;
    }

    .preview-box-outer {
        width: 110px;
        height: 110px;
    }

    .apply-border-button {
        width: 100%;
        padding: 14px;
        font-size: 16px;
        min-width: auto;
    }

    .mount-size-input {
        width: 80px;
        padding: 8px 10px;
        height: 36px;
    }

    .mount-border-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .mount-input-addon {
        height: 36px;
        padding: 8px 10px;
    }
    
    .custom-size-modal .modal-content {
        padding: 15px;
        max-width: 90%;
    }
}

/* --- NEW STYLES END --- */