* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

#site-title {
    font-size: 2rem;
    color: #2c3e50;
}

/* Main container */
#main-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

/* Full width section (header, text blocks) */
.section-full {
    width: 100%;
}

/* Articles grid - auto-fit responsive */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Fields grid */
.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Element base styling */
.element {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Text element */
.element-text {
    font-size: 1rem;
}

.element-text h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.element-text p {
    color: #666;
}

.element-text code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.element-text a {
    color: #3498db;
    text-decoration: none;
}

.element-text a:hover {
    text-decoration: underline;
}

/* Image element */
.element-image {
    padding: 0;
    overflow: hidden;
}

.element-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* Input elements common styling */
.element-input label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

.element-input input,
.element-input select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.element-input input:focus,
.element-input select:focus {
    outline: none;
    border-color: #3498db;
}

/* Article element */
.element-article {
    display: flex;
    flex-direction: column;
}

.element-article .article-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 4px;
    text-align: center;
}

.element-article .article-sublabel {
    font-size: 0.85rem;
    font-style: italic;
    color: #666;
    text-align: center;
    margin-bottom: 10px;
}

.element-article .article-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.element-article .article-image img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    border-radius: 4px;
}

.element-article .article-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.element-article .article-input {
    display: flex;
    align-items: center;
    gap: 0;
}

.element-article .article-input input[type="number"] {
    width: 50px;
    text-align: center;
    padding: 8px 4px;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
    border-radius: 0;
    -moz-appearance: textfield;
}

.element-article .article-input input[type="number"]::-webkit-outer-spin-button,
.element-article .article-input input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.qty-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.qty-btn:hover {
    background: #e9ecef;
}

.qty-btn:active {
    background: #dee2e6;
}

.qty-minus {
    border-radius: 4px 0 0 4px;
}

.qty-plus {
    border-radius: 0 4px 4px 0;
}

.element-article .article-price {
    text-align: right;
}

.element-article .price-info {
    color: #666;
    font-size: 0.9rem;
    display: block;
}

.element-article .line-total {
    font-weight: 600;
    color: #27ae60;
    font-size: 1rem;
}

/* Email element */
.element-email input {
    width: 100%;
}

/* Select element */
.element-select select {
    width: 100%;
    cursor: pointer;
}

/* Form footer */
.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Aftersubmit container */
#aftersubmit-container {
    margin-top: 20px;
    margin-bottom: 0;
}

#aftersubmit-container .element {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    text-align: center;
}

#aftersubmit-container h2 {
    color: #155724;
}

#aftersubmit-container p {
    color: #155724;
}

.total-section {
    font-size: 1.25rem;
}

.total-label {
    color: #666;
    margin-right: 10px;
}

.total-price {
    font-weight: 700;
    color: #27ae60;
    font-size: 1.5rem;
}

#submit-btn {
    background: #3498db;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#submit-btn:hover {
    background: #2980b9;
}

#submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Message display */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.hidden {
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive design */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .form-footer {
        flex-direction: column;
        gap: 15px;
    }

    #submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}
