/* Basic layout */

.page-banner {
    width: 100vw;
    margin: 0 auto 2rem;
    padding: 2rem 0;
    background: var(--secondary-accent);
}

.page-banner h2 {
    text-align: center;
    margin: 0;
}

.container {
    margin: 0 auto;
}

/* Main container layout */
.display-area {
    display: flex;
    width: 100%;
    gap: 20px;
}

.base-image {
    position: relative;
    aspect-ratio: 3/4;
    border: 2px solid var(--primary-accent);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.base-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selections-display {
    flex: 1 0 45%;
    display: flex;
    flex-direction: column;
}

.selection-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 20px;
    height: 100%;
}

.selection-tile {
    width: 100%;
    height: 100%;
    position: relative;
    aspect-ratio: 3/4;
    border: 2px solid var(--primary-accent-light);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.selection-tile h4 {
    text-align: center;
}

.selected-item {
    width: 100%;
    height: calc(100% - 35px);
    overflow: hidden;
}

.selected-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.base-image,
.selection-tile {
    position: relative;
}


/* Options area */
.options-container {
    margin-bottom: 4rem;
    width: 100%;
}

.category-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--secondary-accent);
}

.tab-btn {
    padding: 0.65rem 1.4rem .45rem 3.4rem;
    background: var(--bg-light);
    border: .5px solid var(--bg-medium);
    border-bottom: 6px solid transparent;
    color: var(--gray-light);
    border-radius: 12px 12px 0 0;
    box-shadow: none;
    margin-left: -2rem;
}

.tab-btn.active {
    border-color: var(--gray-light);
    background: var(--bg-medium);
    border-bottom-color: var(--secondary-accent);
    color: var(--gray-dark);
}

.tab-btn:first-child {
    padding: 0.65rem 1.4rem .45rem 1.4rem;
    text-align: center;
    z-index: 10;
    margin-left: 0;
}


.tab-btn:nth-child(2) {
    z-index: 9;
}

.tab-btn:nth-child(3) {
    z-index: 8;
}

.tab-btn:nth-child(4) {
    z-index: 7;
}

.items-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.item-option {
    border-radius: var(--card-radius);
    border: 2px solid var(--bg-light);
    padding: 0;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.item-option:hover {
    border-color: var(--secondary-accent);
    transform: translateY(-3px);
}

.item-option.selected {
    border-color: var(--secondary-accent);
    background-color: var(--secondary-accent);
}

.item-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin-bottom: 8px;
    display: block;
}

.item-name {
    display: block;
    font-weight: bold;
}

/* Action container */
.action-container {
    margin-top: 20px;
    margin-bottom: 4rem;
}

/* Randomize Buttons */
.randomize-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    border: 2px solid var(--primary-accent-dark);
    color: var(--primary-accent-dark);
    font-size: var(--font-size-button);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.randomize-btn:hover {
    background-color: var(--primary-accent-dark);
    border-color: var(--primary-accent);
    color: white;
    transform: scale(1.2);
}

.base-image,
.selected-item {
    position: relative;
}



/* Modal styles */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: var(--card-radius);
    max-width: 800px;
    width: 100%;
    position: relative;
    margin: auto;
}

.modal-content h3 {
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 30px;
    cursor: pointer;
}

.form-group-row {
    display: flex;
    flex-direction: column;
}

#order-form .button-group {
    justify-content: space-between;
}

#submit-btn {
    flex: 1;
}

/* Order summary */
.order-summary {
    display: flex;
    flex-direction: column;
    margin: 1rem 0;
    background-color: #fff;
    border-radius: var(--card-radius);
}

.order-summary-previews {
    display: flex;
    flex-direction: row;
    margin-bottom: 20px;
    gap: 2%;
    height: auto;
    flex-wrap: wrap;
    aspect-ratio: 1 / 1;
}

.summary-tile {
    border-radius: var(--banner-radius);
    aspect-ratio: 3 / 1;
    overflow: hidden;
    width: 32%;
}

.summary-tile:first-child,
.summary-tile:nth-child(2) {
    width: 49%;
    margin-bottom: 2%;
    aspect-ratio: 3 / 2;
}

.summary-tile img {
    width: 100%;
}

/*  */

.order-summary-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
}

#order-details {
    padding: 0 20px;
    flex: 1 0 auto;
}

#order-details h4 {
    border-bottom: 4px solid var(--secondary-accent);
    width: 100%;
    font-size: var(--font-size-modaltitle);
}

#order-details ul {
    list-style: none;
    margin: 1.2em 0;
}

#order-details ul li {
    margin-bottom: 0.6em;
    color: var(--grey-dark);
}

#order-details ul li::before {
    content: "• ";
    color: var(--secondary-accent);
    font-weight: bold;
    margin-right: 0.2em;
}



/* Responsive adjustments */
@media (max-width: 992px) {
    .container {
        margin: 0 2rem;
    }
}


@media (max-width: 768px) {

    .container {
        margin: 0 1rem;
    }

    .display-area,
    .selection-tiles,
    .items-grid {
        gap: 10px;
    }

    .items-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-tabs {
        width: 100%;
    }

    .tab-btn {
        flex: 1;
        width: calc(100%-20px/4);
        padding: 0.65rem 0.5rem;
        overflow-wrap: break-word !important;
    }

    .tab-btn.active {
        min-width: 120px;
        padding: 0.65rem 0;
        z-index: 12;
    }

    .randomize-btn {
        width: 28px;
        height: 28px;
        bottom: 5px;
        right: 5px;
    }

    .order-summary-content {
        flex-direction: column;
        align-items: revert;
    }

    .form-group-row {
        flex-direction: column;
        gap: 0;
    }

    .button-group {
        flex-direction: column;
    }
}

/* Extra small screens */
@media (max-width: 480px) {

    .container {
        margin: 0 0.5rem;
    }

    .action-container {
        display: flex;
        width: 100%;
    }

    .action-container button {
        width: 100%;
    }

    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .display-area {
        flex-direction: column;
    }

    #order-modal {
        padding: 0;
    }

    .modal-content {
        padding: 20px 15px;
    }
}