/* Base styles */
body {
    font-size: 16px;
    font-family: Montserrat, sans-serif;
    line-height: 1.6;
    color: #222323;
    font-weight: 400;
    font-style: normal;
    text-rendering: optimizeLegibility;
    background-color: #f4f4f4;
}
a {
    text-decoration: none;
}
hr {
    border: 0;
    height: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    margin: 1em 0;
    clear: both;
}
form {
    max-width:1000px;
    margin: 0 auto;
}
label {
    display: block;
    text-transform: uppercase;
    font-size: 0.8rem;
}
p {
    margin:4px 0;
}
input, textarea, select {
    border: 1px solid #aaa;
    padding: 8px 10px;
    border-radius: 4px;
    color: #1c1d1d;
}
h1 {
    font-family: Montserrat, sans-serif;
    text-align: center;
    font-size: 2.4rem;
    font-weight: 200;
    margin-bottom: 2rem;
    color: #1c1d1d;
}
.wrapper {
    margin: 0;
    padding: 0 2em 2em;
}

/* Forms grid layout */
.orderform {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    align-items: stretch; 
    flex-grow: 1;
    gap: 4px;
}
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: fit-content;
    margin: 0 auto;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
/* Form cards */
.form-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e1cece;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    text-align: center;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.form-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.form-card img {
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
}

.form-card h2 {
    font-family: Montserrat, sans-serif;
    margin-bottom: 1rem;
    color: #1c1d1d;
}

.form-card p {
    color: #666666;
    margin-bottom: 1.5rem;
    font-size: 1.1em;
}

/* Button styles */
.button {
    display: inline-block;
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-style: normal;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 16px 24px;
    font-size: 0.87em;
    text-decoration: none;
    text-align: center;
    white-space: normal;
    border-radius: 8px;
    background-color: #1c1d1d;
    color: #ffffff;
    transition: background-color 0.4s ease-out;
}

.button:hover {
    background-color: #ce3535;
    color: #ffffff;
    cursor: pointer;
}

.grid {
    max-width: 1000px;
    width: 100%;
    display: grid;
    grid-gap: 20px;
    margin: 0 auto;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

#stole-svg {
    max-width: 100%;
    height: auto;
}

.template {
    font-family: sans-serif;
    position: relative;
    text-align: center;
}

.template img {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.template span {
    font-family: 'American Typewriter', serif;
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1rem;
}
.template .year  {
    font-size: 2.2rem;
}
.template i {
    font-family: 'American Typewriter', serif;
    font-weight: 600;
    font-style: normal;
    display: block;
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
}
.template .stole-left,
.template .stole-right  {
    position: absolute;
    width: 25%;
    height: 30%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-content: stretch;
}
.template .stole-right {
    top: 30%;
    left: 5%;
}


.template #right-top {
    line-height: 1;
    align-content: flex-start;
}

.template #right-middle {
    line-height: 1;
    align-content: center;
}

.template #right-bottom {
    line-height: 1;
    align-content: flex-end;
}

.template .stole-left {
    top: 30%;
    right: 6%;
}

.template #left-top {
    line-height: 1;
    align-content: flex-start;
}

.template #left-middle {
    line-height: 1;
    align-content: center;
}

.template #left-bottom {
    line-height: 1;
    align-content: flex-end;
}

.embroidery-info {
    display: flex;
    justify-content: space-evenly;
    gap: 4px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}
.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap:8px;
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #eee;
    width: 80%;
    max-width: 350px;
    border-radius: 16px;
}
.modal-content h5 {
    margin: 0;
}

.modal-content p {
    margin: 0;
}

.close-modal {
    color: #aaa;
    position: absolute;
    display: block;
    top: 0;
    right: 8px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    height: 24px;
    width: 24px;
}
.close-modal:hover,
.close-modal:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

#desc-label {
    display: none;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .wrapper {
        padding: 0 1em 1em;
    }
    
    .forms-grid {
        padding: 1rem;
    }
    
    .form-card {
        padding: 1.5rem;
    }
    
    .grid, .header {
        grid-template-columns: 1fr;
    }
    h1 {font-size: 6vw;}
    .header {
        display: grid; 
        gap:0;
    }
    .header img {margin: 0 auto;}
    .template span {
        font-size: 2.8vw;
        line-height: 2.8vw;
    }
    .template .year  {
        font-size: 6vw;
    }
    .template i {
        font-size: 4vw;
    }
    .embroidery-info {
        flex-direction: column;
    }   
}

@media screen and (max-width: 480px) {
    
    .form-card img {
        max-width: 150px;
    }
    
    .button {
        padding: 12px 20px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .grid, .header {
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }
    
    .grid .col {
        padding: 15px;
    }
    
    .template span {
        font-size: 3vw;
        line-height: 3vw;
    }
}