/**
 * Strona zamówienia (order.php)
 * Layout formularza, podsumowanie, dane, stopka – bez inline style w PHP.
 */

body {
    background: #f6f8f4;
    margin: 0;
}

.product-page {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.product-header {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.product-header h1 {
    font-size: 2rem;
    margin: 0 0 15px 0;
    color: #1a2612;
}

.order-page {
    margin: 0 auto;
    padding-top: 20px;
}
.order-page:not(.order-seller-footer) {
    max-width: 100%;
}
.order-page.order-seller-footer {
    max-width: 100%;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #dce3d6;
}

.order-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}

.order-form {
    background: #fff;
    padding: 28px 32px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    min-width: 0;
}
.order-form h2 { margin: 0 0 20px 0; font-size: 1.35rem; }

.order-back-link { margin: 0 0 20px 0; }
.order-back-link a { color: #3d6b1e; text-decoration: none; }
.order-back-link a:hover { text-decoration: underline; }

.preview-draft-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.order-form-inner {
    max-width: 100%;
}

.order-summary {
    background: #fff;
    padding: 24px 28px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 24px;
}
.order-summary h3 {
    margin: 0 0 18px 0;
    padding-bottom: 14px;
    border-bottom: 1px solid #dce3d6;
    font-size: 1.15rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #4a5a42;
}
.summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid #dce3d6;
    margin-top: 15px;
    font-size: 1.25rem;
    font-weight: 700;
}
.summary-total .price { color: #16a34a; }

.order-form .form-group { margin-bottom: 18px; }
.order-form .form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #374151; }
.order-form .form-group input[type="text"],
.order-form .form-group input[type="email"] {
    display: block;
    width: 100%;
    max-width: 320px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}
.order-form .form-group input:focus {
    border-color: #3d6b1e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(61,107,30,0.15);
}
.order-form .form-hint {
    font-size: 0.85rem;
    color: #5c6b54;
    margin-top: 6px;
}
.order-form .form-error-msg {
    display: none;
    margin-top: 6px;
    font-size: 0.9rem;
    color: #b91c1c;
}
.order-form .form-group-checkbox { margin-top: 20px; }
.order-form .form-group-checkbox:first-of-type { margin-top: 22px; }
.order-form .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: normal;
}
.order-form .checkbox-label input { margin-top: 4px; flex-shrink: 0; max-width: none; }

.discount-message {
    margin-top: 10px;
    font-size: 0.9rem;
    min-height: 20px;
}
.summary-discount-amount { color: #16a34a; }

.btn-buy,
.btn-order {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 320px;
    min-height: 48px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(61, 107, 30, 0.3);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(61, 107, 30, 0.2);
}
.btn-buy:hover,
.btn-order:hover {
    background: linear-gradient(135deg, #2d5016 0%, #581c87 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 107, 30, 0.4);
}

.order-form .alert-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.affiliate-note {
    background: #f0fdf4;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #166534;
}

.order-page .seller-info,
.order-seller-footer .seller-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 24px;
    background: #f6f8f4;
    border-radius: 12px;
    margin-top: 0;
}
.order-page .seller-avatar,
.order-seller-footer .seller-avatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
    overflow: hidden;
}
.order-page .seller-avatar img,
.order-seller-footer .seller-avatar img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}
.order-page .seller-name { font-weight: 600; color: #1a2612; }
.order-page .seller-name a.link-author-page { color: #3d6b1e; text-decoration: none; }
.order-page .seller-name a.link-author-page:hover { text-decoration: underline; }
.order-seller-footer .seller-details { display: flex; flex-direction: column; gap: 6px; }
.order-seller-footer .btn-contact-seller {
    display: inline-block;
    margin-top: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.order-seller-footer .btn-contact-seller:hover { opacity: 0.95; }
.order-page .seller-bio { font-size: 0.9rem; color: #5c6b54; margin-top: 4px; }

@media (max-width: 768px) {
    .order-grid {
        grid-template-columns: 1fr;
    }
    .order-summary {
        position: static;
    }
}

@media (max-width: 600px) {
    .order-page { padding-left: 16px; padding-right: 16px; }
    .order-form .form-group input[type="text"],
    .order-form .form-group input[type="email"] { max-width: none; }
    .btn-buy, .btn-order { max-width: none; }
}

/* Dark mode – order */
[data-theme="dark"] body { background: #0d0d0d; }
[data-theme="dark"] .product-header {
    background: #1a1a1a;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
[data-theme="dark"] .product-header h1 { color: #ffffff; }
[data-theme="dark"] .order-form {
    background: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
[data-theme="dark"] .order-form h2 { color: #ffffff; }
[data-theme="dark"] .order-summary {
    background: #1a1a1a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
[data-theme="dark"] .order-summary h3 { color: #ffffff; border-color: #333333; }
[data-theme="dark"] .summary-item { color: #b0b0b0; }
[data-theme="dark"] .summary-total { border-color: #333333; color: #ffffff; }
[data-theme="dark"] .order-back-link a { color: #86c44a; }
[data-theme="dark"] .preview-draft-banner {
    background: rgba(245,158,11,0.2);
    border-color: #f59e0b;
    color: #fcd34d;
}
[data-theme="dark"] .order-form .form-group label { color: #e5e5e5; }
[data-theme="dark"] .order-form .form-hint { color: #9ca3af; }
[data-theme="dark"] .order-form .form-group input {
    background: #1a1a1a;
    border-color: #333333;
    color: #ffffff;
}
[data-theme="dark"] .order-form .form-group input:focus {
    border-color: #4a8c1f;
    box-shadow: 0 0 0 3px rgba(74,140,31,0.2);
}
[data-theme="dark"] .order-form .form-error-msg { color: #f87171; }
[data-theme="dark"] .order-form .alert-error {
    background: rgba(239,68,68,0.15);
    color: #f87171;
}
[data-theme="dark"] .affiliate-note {
    background: rgba(74,140,31,0.15);
    color: #6abf2a;
}
[data-theme="dark"] .order-page.order-seller-footer { border-top-color: #333333; }
[data-theme="dark"] .order-page .seller-info { background: #252525; }
[data-theme="dark"] .order-page .seller-name { color: #ffffff; }
[data-theme="dark"] .order-page .seller-name a.link-author-page { color: #86c44a; }
[data-theme="dark"] .order-page .seller-name a.link-author-page:hover { color: #a3d96c; }
[data-theme="dark"] .order-page .seller-bio { color: #b0b0b0; }
