/* =========================================
   GLOBAL RESET
========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Shared max width */
.custom-setup-dashboard,
.builder-dashboard {
    max-width: 1400px;
    margin-inline: auto;
    width: 100%;
    min-width: 0; /* 🔑 */
}

.custom-setup-dashboard{
    padding-inline: 20px;
}

@media (min-width: 1400px) {
    .user-profile-page {
        padding-inline: 40px;
    }
}









































/* =========================================
   CUSTOM SETUP PAGE
========================================= */

.custom-setup-dashboard h1 {
    margin-bottom: 15px;
}

.custom-setup-dashboard p {
    margin-bottom: 25px;
    max-width: 700px;
}

.saved-builds {
    list-style: none;
}

.saved-build {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.build-actions {
    display: flex;
    gap: 10px;
}

.btn-continue-setup,
.btn-create-setup {
    display: inline-block;
    padding: 10px 18px;
    background: #111;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

.btn-delete-build {
    padding: 10px 18px;
    border: 1px solid #111;
    background: transparent;
    cursor: pointer;
}









































/* =========================================
   BUILDER NAV
========================================= */

.builder-nav {
    display: flex;
    align-items: center;
    padding-left: 10px;
}

.builder-nav svg {
    height: 20px;
}

.builder-nav a {
    text-decoration: none;
    color: #000;
    font-size: 15px;
    font-weight: 600;
}

.builder-dashboard h1 {
    padding: 20px;
}

/* =========================================
   BUILDER SECTIONS
========================================= */

.builder-parts {
    display: flex;
    flex-direction: column;
    gap: 35px;
    margin-top: 20px;
}

.builder-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: #ebebeb;
    padding: 30px 20px;
}

.builder-section-title.optional {
    color: #666;
}

/* =========================================
   RESPONSIVE GRID
========================================= */

.builder-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(100px, 1fr));
    gap: 10px;
    padding: 30px 10px;
    margin: 0 auto;
}

@media (min-width: 700px) {
    .builder-section {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
        max-width: 100%;
    }
}

@media (min-width: 1000px) {
    .builder-section {
        grid-template-columns: repeat(4, minmax(100px, 1fr));
    }
}

@media (min-width: 1300px) {
    .builder-section {
        grid-template-columns: repeat(6, minmax(100px, 1fr));
    }
}

/* =========================================
   BUILDER ITEM
========================================= */

.builder-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 10px;
}

.builder-item h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    align-self: center;
}

.builder-item p {
    text-align: left;
    margin: 8px 0;
}

.builder-item button {
    padding: 0;
    margin-bottom: 50px;
}

/* =========================================
   PRODUCT VISUAL
========================================= */

.builder-visual {
    width: 100%;
    aspect-ratio: 6 / 7;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 10px;
}

.builder-product-image,
.builder-product-image img,
.builder-svg svg,
.builder-svg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 2 line clamp */
.builder-item p strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    min-height: calc(1.3em * 2);
}

/* Buttons */
.builder-item .open-product-modal {
    width: fit-content;
}

.open-product-modal.edit {
    width: 100%;
    padding: 8px 12px;
    font-weight: 600;
}

.open-product-modal.select {
    width: 100%;
    padding: 8px 12px;
    font-weight: 600;
}



/* Optional fade */
.builder-section.optional .builder-item {
    opacity: 0.85;
}

/* =========================================
   CART AREA
========================================= */

.builder-cart-action {
    margin-top: 40px;
    text-align: center;
}

.builder-cart-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.builder-total-price {
    font-size: 1.3rem;
    font-weight: 700;
}

.btn-add-to-cart {
    height: 40px;
    padding: 0 20px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-add-to-cart.disabled {
    background: #aaa;
    cursor: not-allowed;
}

.missing-parts {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #b00000;
}










/* =========================================
   POP UP AREA
========================================= */


/* ===============================
   FULLSCREEN PRODUCT MODAL
================================ */

.product-modal {
    max-width: 1400px;
    margin-inline: auto;
    width: 100%;
    min-width: 0; /* 🔑 */
}

.product-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;

    display: none;
}

.product-modal.active {
    display: flex;
}


/* Disable background scroll */
body.modal-open {
    overflow: hidden;
}


/* ===============================
   MODAL CONTENT
================================ */

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #fff;
    overflow-y: auto;
    padding: 60px 10px 80px;
    box-sizing: border-box;
}


/* ===============================
   CLOSE BUTTON (TOP RIGHT)
================================ */

.close-modal {
    position: fixed;
    top: 25px;
    right: 35px;
    cursor: pointer;
    z-index: 100000;
}

.close-modal svg {
    width: 26px;
    height: 26px;
    display: block;
}


/* ===============================
   MODAL TITLE
================================ */

#modal-title {
    margin-bottom: 40px;
    font-size: 28px;
    font-weight: 600;
}


/* ===============================
   PRODUCT GRID
================================ */

.modal-products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}


/* ===============================
   PRODUCT CARD
================================ */

.modal-product {
    width: 100%;
    box-sizing: border-box;
}

.modal-product-title {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.4;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;

    min-height: calc(1.4em * 2); /* forces exactly 2 lines of space */
}

.modal-product-price {
    margin-top: 6px;
    font-weight: 600;
}


/* ===============================
   IMAGE CONTROL
================================ */

.modal-product-image-wrapper {
    width: 100%;
    aspect-ratio: 6 / 7; /* change if needed */
    overflow: hidden;
}

.modal-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* ===============================
   RESPONSIVE
================================ */


/* Tablet */
@media (min-width: 768px) {
    .modal-products {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .modal-content {
        padding: 40px 20px 60px;
    }
}

/* Desktop */
@media (min-width: 1200px) {
    .modal-products {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}





























/* =========================================
   BUILDER PRODUCT PAGE
========================================= */

.builder-product-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.builder-back {
    display: inline-block;
    margin-bottom: 30px;
    text-decoration: none;
    font-weight: 600;
    color: #000;
}

.builder-product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 900px) {
    .builder-product-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.builder-product-images img {
    width: 100%;
    height: auto;
}

.builder-product-info h1 {
    margin-bottom: 15px;
}

.builder-product-info .price {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 20px;
}






.variation-label {
    font-size: 20px;
    margin-bottom: 8px;
    font-weight: 500;
}


.variation-options {
    display: flex;
    gap: 10px;
}

.variation-btn {
    padding: 10px 14px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 15px;
    font-weight: 500;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.variation-btn.active {
    background: #222;
    color: #fff;
}


.variation-btn:hover {
    border: 1px solid #222;
}



.btn-add-to-builder {
    margin-top: 20px;
    padding: 12px 20px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}