/* /clothing/custom/custom-clothing-style.css */

/* ==================
   General Layout 
   ================== */
.designer-container {
    max-width: var(--layout-max);
    padding: var(--panel-padding);
    background-color: rgba(0, 0, 0, 0.2);
}

.design-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.design-section {
    padding: var(--space-md);
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
}

.design-section h2 {
    color: var(--yellow);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

@media (max-width: 540px) {
    section {
        margin-inline: 0.5rem;
    }
}

/* ==================
   Garment Selection
   ================== */
.unit-tabs {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-xs);
}

.unit-tab {
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border: var(--border-width-thin) solid white;
    border-radius: var(--radius-md);
    background: var(--section);
    cursor: pointer;
    font-size: 1.25rem;
    position: relative;
    transition: all var(--transition-base);
}

.unit-tab:hover {
    color: var(--brand-yellow);
}

.unit-tab.active {
    color: var(--text-on-light);
    font-weight: bold;
    background-color: var(--brand-yellow);
    border-color: var(--brand-yellow);
}

.garment-selection-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-lg);
    position: static;
    overflow: visible;
}

/* Product Grid */
.product-grid {
    display: grid;
    justify-items: center;
    align-content: start;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-sm);
}

/* Product Card */
.product-card {
    position: relative;
    text-align: center;
    transition: all var(--transition-base);
    width: 230px;
}

.product-card:hover {
    box-shadow: var(--shadow-focus);
}

.product-card.unselected {
    opacity: 0.25;
    filter: grayscale(0.5);
}

/* Product Card Selection */
.product-card .garment-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.product-card .product-content {
    display: block;
    cursor: pointer;
    margin: var(--space-sm);
}

/* Product Image */
.product-image {
    width: 150px;
    height: 150px;
    margin: 0 auto 0.5rem;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey);
    font-size: 1.2rem;
}

/* Product Info */
.product-info h3 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.price {
    color: var(--brand-yellow);
    font-weight: bold;
}

.status {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.status.in-stock {
    background-color: var(--brand-green-soft);
    color: var(--brand-green);
}

/* ==================
   Size Selector
   ================== */
.size-selector {
    position: sticky;
    top: 3rem;
    height: fit-content;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 10px;
}

.size-selector h3 {
    color: var(--yellow);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.size-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.size-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
}

.size-label {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.quantity-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background-color: var(--yellow);
    color: black;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: var(--pink);
}

.quantity-controls input {
    width: 3rem;
    text-align: center;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
}

.size-summary {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 2rem;
}

/* ==================
   Color Selection Modal
   ================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal.active {
    visibility: visible;
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.8);  /* End with semi-transparent background */
}

.modal-content {
    background-color: var(--section);
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    color: white;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex; /* Enables flexible layout */
    flex-direction: column; /* Ensures correct structure */
    max-height: 90vh; /* Restrict height to prevent full-screen overflow */
    overflow: hidden; /* Prevents content from breaking layout */
}

.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--yellow);
    font-size: 1.5rem;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: red;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.close-modal:hover {
    color: var(--yellow);
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.color-option {
    aspect-ratio: 1;
    border: 1px solid var(--grey);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.color-option:hover {
    border-color: var(--yellow);
    box-shadow: 0 0 6px 3px var(--yellowGlow);
    transform: scale(1.05);
}

.color-option.selected {
    border: 2px solid var(--yellow);
    box-shadow: 0 0 6px 3px var(--yellowGlow);
    background-color: rgba(255, 199, 37, 0.1);
}

.color-option.selected .color-name {
    background-color: var(--yellow);
    color: black;
}

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

.color-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.color-option:hover .color-name {
    background: var(--yellow);
    color: black;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: right;
}

.confirm-color:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.color-grid .loading,
.color-grid .error,
.color-grid .no-colors {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: white;
    min-height: 200px;
}

.color-grid .loading {
    position: relative;
    padding-bottom: 4rem;
}

.color-grid .loading::after {
    content: '';
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid var(--grey);
    border-top-color: var(--yellow);
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

.color-grid .error {
    color: var(--pink);
}

.color-grid .no-colors {
    color: var(--grey);
}

@keyframes spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

.selected-color {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--yellow);
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid var(--grey);
}

/* ==================
   Print Areas
   ================== */
.print-areas-container {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 10px;
}

.print-areas-list {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    gap: 2rem;
}

.print-area-group {
    width: 45%;
}

.print-area-group h3 {
    color: var(--yellow);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.print-area-option {
    margin-bottom: 1rem;
}

.print-area-option input[type="checkbox"] {
    display: none;
}

.print-area-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.print-area-label:hover {
    border-color: var(--yellow);
    box-shadow: 0 0 6px 3px var(--yellowGlow);
}

.print-area-option input[type="checkbox"]:checked + .print-area-label {
    border-color: var(--yellow);
    box-shadow: 0 0 6px 3px var(--yellowGlow);
    background-color: rgba(255, 199, 37, 0.1);
}

.print-area-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.area-name {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
}

.area-size {
    color: #999;
    font-size: 0.9rem;
}

.print-area-price {
    color: var(--yellow);
    font-size: 1.2rem;
    font-weight: 600;
}

.print-areas-summary {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    color: white;
}

.selected-areas, .print-areas-total {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.print-areas-total {
    color: var(--yellow);
    font-weight: 600;
}

@media (max-width: 540px) {
    .print-areas-list {
        flex-direction: column;
    }

    .print-area-group {
        width: auto;
    }
}

/* ==================
   Design Upload
   ================== */
.design-upload-container {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    gap: 2rem;
}

@media (max-width: 540px) {
    .design-upload-container {
        flex-direction: column;
    }
}

.upload-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.upload-area h3 {
    color: var(--yellow);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.upload-box {
    position: relative;
    min-height: 200px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px dashed var(--grey);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-box:hover {
    border-color: var(--yellow);
    box-shadow: 0 0 6px 3px var(--yellowGlow);
}

.upload-box.dragover {
    border-color: var(--yellow);
    background-color: rgba(255, 199, 37, 0.1);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.upload-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    color: white;
}

.upload-icon {
    color: var(--yellow);
}

.upload-text {
    text-align: center;
}

.primary-text {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.secondary-text {
    color: #999;
    font-size: 0.9rem;
}

.preview-upload-container {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.preview-upload-container.hidden {
    display: none;
}

.design-preview {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.remove-image {
    position: absolute;
    z-index: 100;
    top: 0.5rem;
    right: 0.5rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--yellow);
    color: black;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-image:hover {
    background-color: var(--pink);
}

.upload-requirements {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
}

.upload-requirements h4 {
    color: var(--yellow);
    margin-bottom: 0.5rem;
}

.upload-requirements ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #999;
}

.upload-requirements li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* ==================
   Preview
   ================== */
.preview-section {
    padding-inline: 2rem;
    border-radius: 10px;
    margin: 1rem 0;
    transition: opacity 0.3s ease-in-out;
}

.preview-section:not(.preview-active) {
    opacity: 0;
}

.preview-section.preview-active {
    opacity: 1;
}

.preview-section h2 {
    color: var(--yellow);
    text-align: center;
    margin-bottom: 3rem;
}

.preview-container {
    display: flex;
    justify-content: center;
    gap: 4rem;
    max-width: 1200px;
    max-height: 100%;
    margin: 0 auto;
}

.preview-side {
    flex: 1;
    max-width: 500px;
}

.preview-side h3 {
    color: var(--yellow);
    text-align: center;
    margin-bottom: 1rem;
}

.preview-side svg {
    width: 100%;
    height: auto;
}

.cls-1 {
    fill: #ffffff;
}

.print-area-indicator {
    fill: rgba(255, 199, 37, 0.1);
    stroke: var(--yellow);
    stroke-width: 2;
    stroke-dasharray: 5,5;
    opacity: 0.5;
    pointer-events: none;
}

.design-image {
    opacity: 1;
}

.design-image.hidden {
    opacity: 0;
}

@media (max-width: 768px) {
    .preview-container {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }

    .preview-side {
        width: 100%;
        max-width: 400px;
    }
}

/* ==================
   Order Details
   ================== */
.order-details-section {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 
    "notes help"
    "submit submit";
}

@media (max-width: 1000px) {
    .order-details-section {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "help"
            "notes" 
            "submit";
    }
 }

.notes-field {
    grid-area: notes;
    padding: 1rem;
    background: var(--section);
    border-radius: 8px;
    height: -webkit-fill-available;
    height: -moz-available;
    height: fill-available;
    height: stretch;
}

.notes-field label {
    display: block;
    color: white;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.notes-field textarea {
    width: -webkit-fill-available;
    width: -moz-available;
    width: fill-available;
    width: stretch;
    min-height: 100px;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--grey);
    color: white;
    font-family: inherit;
    resize: vertical;
}

.notes-field textarea:focus {
    outline: 2px solid var(--yellow);
}

/* ==================
   Form Footer
   ================== */
   .design-help-container {
    padding: 2rem;
    background: var(--section);
    border-radius: 8px;
    grid-area: help;
}

.design-help-copy h2 {
    color: var(--yellow);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    text-align: center;
}

.design-help-copy p {
    color: white;
    margin-bottom: 1rem;
    text-align: center;
}

.design-help-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.help-option {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border: 2px solid var(--grey);
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.help-option:hover {
    border-color: var(--yellow);
    box-shadow: 0 0 6px 3px var(--yellowGlow);
}

.help-option p {
    color: white;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 500;
}

.help-option .price {
    color: var(--yellow);
    font-weight: bold;
    text-align: center;
    font-size: 1.5rem;
}

.help-option.selected {
    border-color: var(--yellow);
    background-color: rgba(255, 199, 37, 0.1);
    box-shadow: 0 0 6px 3px var(--yellowGlow);
}

.design-help-op:last-child {
    text-align: center;
}

.design-help-op:last-child p {
    color: white;
    margin-bottom: 1rem;
}

/* ==================
   Form Navigation
   ================== */
/* Navigation Controls */
.design-navigation {
    margin-bottom: 2rem;
    padding: 1rem;
}

.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.nav-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.step-indicator {
    color: white;
    font-size: 1.2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--yellow);
    transition: width 0.3s ease;
    width: 20%; /* Will be updated by JavaScript */
}

/* Hide all sections initially except first */
.design-section:not(:first-of-type) {
    display: none;
}

/* ==================
   Form Footer
   ================== */
.form-footer {
    grid-area: submit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-top: 1rem;
}

.price-display {
    color: white;
    font-size: 1.2rem;
}

#total-price {
    color: var(--yellow);
    font-weight: bold;
    font-size: 1.5rem;
}

/* ==================
   Process Section
   ================== */
.process-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.process-item {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 2rem;
    position: relative;
    color: white;
}

.process-number {
    position: absolute;
    top: -1rem;
    left: -1rem;
    width: 3rem;
    height: 3rem;
    background-color: var(--yellow);
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.process-item h3 {
    color: var(--yellow);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.process-item p {
    line-height: 1.6;
}

/* ==================
   Custom Projects
   ================== */
.custom-projects {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
}

.custom-projects h3 {
    color: var(--yellow);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.custom-projects p {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.custom-projects ul {
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.custom-projects li {
    font-size: 1.5rem;
    font-weight: 600;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

/* ==================
   Media Queries
   ================== */
   @media (max-width: 768px) {
    .garment-selection-grid {
        grid-template-columns: 1fr;
    }

    .designer-container,
    .size-selector,
    .print-areas-container,
    .design-upload-container {
        padding: 1rem;
    }

    .size-row,
    .print-area-label {
        padding: 0.75rem;
    }

    .size-label {
        font-size: 1rem;
    }

    .print-areas-summary {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        text-align: center;
    }

    .form-footer {
        gap: 1rem;
        text-align: center;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .custom-projects ul {
        grid-template-columns: 1fr;
    }

    .upload-box {
        min-height: 150px;
    }

    .primary-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .designer-container {
        padding: 1rem;
    }

    .design-section {
        padding: 1rem;
    }

    .process-item {
        padding: 1.5rem;
    }

    .process-item h3 {
        font-size: 1.2rem;
    }

    .custom-projects h3 {
        font-size: 1.5rem;
    }

    .price-display {
        font-size: 1rem;
    }

    #total-price {
        font-size: 1.3rem;
    }
}
