* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

html {
    scrollbar-gutter: stable;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

.site-header {
    background: #111827;
    color: white;
    padding: 28px 0;
    margin-bottom: 28px;
}

.header-content {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
}

.site-header h1 {
    margin: 0;
    font-size: 2rem;
}

.site-header p {
    margin: 6px 0 0;
    opacity: 0.85;
}

.cart-button {
    background: white;
    color: #111827;
    border: none;
    border-radius: 999px;
    padding: 12px 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
    min-width: 170px;
    justify-content: center;
}

#cartCount {
    background: #111827;
    color: white;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.85rem;
}

.status-message {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: white;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
    padding-bottom: 40px;
}

.product-card {
    position: relative;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.personalized-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #111827;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 6px 10px;
    border-radius: 999px;
    z-index: 2;
}

.product-image-wrap {
    background: #eee;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-title {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.product-description {
    color: #555;
    font-size: 0.95rem;
    min-height: 42px;
}

.product-price {
    display: inline-block;
    align-self: flex-start;
    font-weight: bold;
    font-size: 1.1rem;
    margin: 12px 0;
    background: #eef2ff;
    color: #111827;
    padding: 7px 12px;
    border-radius: 999px;
}

.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.toggle-button,
.add-button,
.checkout-button {
    cursor: pointer;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: bold;
}

.toggle-button {
    background: #e5e7eb;
}

.toggle-button.active {
    background: #111827;
    color: white;
}

.form-row {
    margin-bottom: 12px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

select,
input {
    width: 100%;
    padding: 10px;
    border: 1px solid #bbb;
    border-radius: 8px;
    font-size: 1rem;
}

.add-button {
    width: 100%;
    background: #111827;
    color: white;
    margin-top: auto;
}

.add-button:hover {
    background: #374151;
}

.add-button.added {
    background: #15803d;
}

.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    z-index: 10;
}

.cart-overlay.open {
    display: block;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: min(420px, 92vw);
    height: 100vh;
    background: white;
    z-index: 11;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transition: right 0.2s ease;
}

.cart-drawer.open {
    right: 0;
}

.cart-header {
    padding: 18px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header h2 {
    margin: 0;
}

#closeCartButton {
    border: none;
    background: #e5e7eb;
    border-radius: 8px;
    font-size: 1.5rem;
    width: 38px;
    height: 38px;
    cursor: pointer;
}

.cart-items {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.empty-cart {
    color: #666;
    text-align: center;
    margin-top: 40px;
}

.cart-item {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
}

.cart-item-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.cart-item-meta {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.cart-item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.remove-item {
    border: none;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-weight: bold;
}

.cart-footer {
    padding: 18px;
    border-top: 1px solid #ddd;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 1.15rem;
}

.checkout-button {
    width: 100%;
    background: #111827;
    color: white;
}

.checkout-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .header-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .cart-button {
        width: 100%;
        justify-content: center;
    }
}

.cart-item-layout {
    display: flex;
    gap: 12px;
}

.cart-item-thumb {
    width: 72px;
    height: 72px;
    object-fit: contain;
    background: #f3f4f6;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
}

.qty-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-controls button {
    border: none;
    background: #e5e7eb;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    font-weight: bold;
    cursor: pointer;
}

.qty-controls span {
    min-width: 22px;
    text-align: center;
    font-weight: bold;
}

.cart-line-total {
    margin-top: 8px;
    font-weight: bold;
    text-align: right;
}

.empty-cart-button {
    width: 100%;
    margin-top: 10px;
    background: #fee2e2;
    color: #991b1b;
    border: none;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: bold;
    cursor: pointer;
}

.empty-cart-button:hover {
    background: #fecaca;
}

.floating-cart-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9;
    background: #111827;
    color: white;
    border: none;
    border-radius: 999px;
    padding: 12px 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
}

#floatingCartCount {
    background: white;
    color: #111827;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.85rem;
}

#floatingCartTotal {
    font-size: 0.95rem;
}

@media (min-width: 900px) {
    .floating-cart-button {
        display: none;
    }
}

.custom-fields:empty {
    display: none;
}

.custom-fields {
    margin: 14px 0;
    padding: 14px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 12px;
}

.customization-title {
    font-weight: 800;
    color: #92400e;
    margin-bottom: 12px;
    border-bottom: 1px solid #f59e0b;
    padding-bottom: 6px;
}

.optional-text {
    font-weight: normal;
    font-style: italic;
    color: #7c5a16;
}

.custom-fields label {
    font-weight: 800;
    color: #111827;
}

.cart-customization {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-weight: 700;
}

.checkout-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.checkout-modal.open {
    display: flex;
}

.checkout-panel {
    background: white;
    width: min(720px, 96vw);
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
}

.checkout-header {
    padding: 18px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-header h2 {
    margin: 0;
}

#closeCheckoutButton {
    border: none;
    background: #e5e7eb;
    border-radius: 8px;
    font-size: 1.5rem;
    width: 38px;
    height: 38px;
    cursor: pointer;
}

.checkout-form {
    padding: 18px;
}

.checkout-form h3 {
    margin: 22px 0 12px;
}

.payment-options {
    display: grid;
    gap: 10px;
}

.payment-option {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
}

.payment-option input {
    width: auto;
}

.checkout-review-item {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
}

.checkout-review-title {
    font-weight: bold;
}

.checkout-review-meta {
    color: #555;
    font-size: 0.92rem;
    line-height: 1.45;
    margin-top: 4px;
}

.checkout-total-row {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #ddd;
    margin-top: 18px;
    padding-top: 16px;
    font-size: 1.2rem;
}

.submit-order-button {
    width: 100%;
    margin-top: 18px;
    background: #111827;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 13px 14px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
}

.submit-order-button:hover {
    background: #374151;
}

@media (max-width: 640px) {
    .checkout-modal {
        align-items: stretch;
        padding: 0;
    }

    .checkout-panel {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
}

.checkout-customization {
    margin-top: 8px;
    padding: 8px 10px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: #92400e;
    font-weight: 700;
}

.customization-title {
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.image-status {

    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 14px;

    font-size: .85rem;

    color: #666;

}

.image-side {

    font-weight: bold;
    color: #111827;

}

.image-hint {

    font-style: italic;

}

.image-toggle-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.image-toggle-tabs button {
    border-radius: 0;
    background: white;
    color: #555;
    padding: 12px;
}

.image-toggle-tabs button.active {
    background: #111827;
    color: white;
}

.image-toggle-tabs button:first-child {
    border-right: 1px solid #ddd;
}

.site-closed-card {
    max-width: 640px;
    margin: 48px auto;
    padding: 32px;
    text-align: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.site-closed-card h2 {
    margin-top: 0;
    font-size: 2rem;
}

.site-closed-card p {
    font-size: 1.05rem;
    line-height: 1.5;
}