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

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    background: white;
    padding: 60px 0;
    text-align: center;
}

.hero h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 20px;
}

.hero .subtitle {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.hidden-code-hint {
    display: inline-block;
    padding: 15px 30px;
    background: #fff3cd;
    border: 2px dashed #ff9800;
    border-radius: 5px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #333;
}

.hidden-code-hint code {
    color: #e91e63;
    font-size: 1.2rem;
}

/* Products Section */
.products {
    padding: 60px 0;
    background: #f9f9f9;
}

.products h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: #333;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.product-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.product-card.featured {
    border: 3px solid #3d6b1e;
    position: relative;
}

.product-card.featured::before {
    content: "POLECAMY";
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: white;
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.product-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.product-card .price {
    font-size: 2rem;
    color: #3d6b1e;
    font-weight: bold;
    margin: 20px 0;
}

.product-card .features {
    list-style: none;
    margin: 20px 0;
    text-align: left;
}

.product-card .features li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.product-card .features li::before {
    content: "✓ ";
    color: #4CAF50;
    font-weight: bold;
    margin-right: 10px;
}

/* Buttons - Unified Style */
.btn {
    display: inline-block;
    margin: 0 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(61, 107, 30, 0.3);
}

.btn:hover {
    background: linear-gradient(135deg, #2d5016 0%, #581c87 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 107, 30, 0.4);
    color: #fff;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(61, 107, 30, 0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2d5016 0%, #581c87 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 107, 30, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #4a5a42 0%, #1a2612 100%);
    color: #fff;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #1a2612 0%, #1a2612 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid #3d6b1e;
    color: #3d6b1e;
    box-shadow: none;
}

.btn-outline:hover {
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 107, 30, 0.4);
}

.btn-large {
    padding: 16px 40px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Order Form */
#order-form {
    background: white;
    padding: 60px 0;
}

#order-form h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: #333;
}

.order-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3d6b1e;
}

.discount-section {
    background: #fff3cd;
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

.discount-input-group {
    display: flex;
    gap: 10px;
}

.discount-input-group input {
    flex: 1;
}

.discount-input-group button {
    flex-shrink: 0;
}

.discount-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    display: none;
}

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

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

.price-summary {
    background: white;
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
}

.price-summary .price-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.price-summary .price-row.total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #3d6b1e;
    border-bottom: none;
    margin-top: 10px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Footer */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
}

footer p {
    margin: 5px 0;
}

footer a {
    color: #5a9a2e;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .order-form-container {
        padding: 20px;
    }
    
    .discount-input-group {
        flex-direction: column;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3d6b1e;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Code styling */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
}

pre code {
    background: transparent;
    color: inherit;
}

/* =====================================================
   DARK MODE SUPPORT
   ===================================================== */

/* Dark mode CSS variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8f4;
    --bg-tertiary: #f0f4ed;
    --text-primary: #1a2612;
    --text-secondary: #5c6b54;
    --text-muted: #8a9a7e;
    --border-color: #dce3d6;
    --card-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.1);
    --input-bg: #ffffff;
    --input-border: #c5d1bc;
    --accent-primary: #3d6b1e;
    --accent-secondary: #6b21a8;
}

[data-theme="dark"] {
    --bg-primary: #0d0d0d;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #707070;
    --border-color: #2a2a2a;
    --card-bg: #1a1a1a;
    --card-shadow: rgba(0, 0, 0, 0.6);
    --input-bg: #1a1a1a;
    --input-border: #333333;
    --accent-primary: #4a8c1f;
    --accent-secondary: #8b5cf6;
}

/* Apply dark mode to body */
[data-theme="dark"] body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .site-header,
[data-theme="dark"] header:not(.product-header) {
    background: var(--bg-secondary);
    box-shadow: 0 1px 3px var(--card-shadow);
}

[data-theme="dark"] .product-card,
[data-theme="dark"] .card,
[data-theme="dark"] .order-form-container {
    background: var(--card-bg);
    box-shadow: 0 4px 15px var(--card-shadow);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group select:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--accent-primary);
}

[data-theme="dark"] footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

/* =====================================================
   PRODUCT FOOTER (strona produktu + zamówienia)
   ===================================================== */
.product-footer {
    background: #1a2612;
    color: #8a9a7e;
    padding: 25px 20px;
    margin-top: 40px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}
.product-footer-main { margin-bottom: 10px; }
.product-footer-main a { color: #fff; text-decoration: none; }
.product-footer-main a:hover { text-decoration: underline; }
.product-footer-links { font-size: 0.75rem; margin-bottom: 12px; }
.product-footer-links a { color: #5c6b54; text-decoration: none; }
.product-footer-links a:hover { color: #8a9a7e; }
.product-footer-disclaimer {
    font-size: 0.7rem;
    color: #4a5a42;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
    padding-top: 12px;
    border-top: 1px solid #2a3318;
}
[data-theme="dark"] .product-footer { background: #0d0d0d; border-top: 1px solid #1a1a1a; }
[data-theme="dark"] .product-footer-main a { color: #e5e5e5; }
[data-theme="dark"] .product-footer-links a { color: #4a8c1f; }
[data-theme="dark"] .product-footer-links a:hover { color: #6abf2a; }
[data-theme="dark"] .product-footer-disclaimer { color: #6b6b6b; border-top-color: #2a2a2a; }

[data-theme="dark"] .mobile-bottom-nav {
    background: var(--bg-secondary);
    box-shadow: 0 -2px 10px var(--card-shadow);
}

[data-theme="dark"] .mobile-nav-item {
    color: var(--text-secondary);
}

[data-theme="dark"] .mobile-nav-item.active {
    color: var(--accent-primary);
}

[data-theme="dark"] .mobile-nav-item:hover {
    background: var(--bg-tertiary);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.dark-mode-toggle:hover {
    background: var(--border-color);
    transform: scale(1.1);
}

[data-theme="dark"] .dark-mode-toggle {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .dark-mode-toggle:hover {
    background: var(--border-color);
}

/* Smooth transition for theme change */
body,
.site-header,
.card,
.product-card,
.mobile-bottom-nav,
footer,
input,
textarea,
select {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Media query for system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0d0d0d;
        --bg-secondary: #141414;
        --bg-tertiary: #1a1a1a;
        --text-primary: #ffffff;
        --text-secondary: #b0b0b0;
        --text-muted: #707070;
        --border-color: #2a2a2a;
        --card-bg: #1a1a1a;
        --card-shadow: rgba(0, 0, 0, 0.6);
        --input-bg: #1a1a1a;
        --input-border: #333333;
        --accent-primary: #4a8c1f;
        --accent-secondary: #8b5cf6;
    }
}

/* Additional dark mode overrides */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #ffffff;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] li {
    color: #d0d0d0;
}

[data-theme="dark"] a {
    color: #4a8c1f;
}

[data-theme="dark"] a:hover {
    color: #5da025;
}

[data-theme="dark"] .hero,
[data-theme="dark"] .products,
[data-theme="dark"] section {
    background: var(--bg-primary);
}

[data-theme="dark"] .product-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .product-card .price {
    color: #4a8c1f;
}

[data-theme="dark"] .product-card h3 {
    color: #ffffff;
}

[data-theme="dark"] .product-card p {
    color: #b0b0b0;
}

[data-theme="dark"] .btn {
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .btn:hover {
    background: linear-gradient(135deg, #2d5016 0%, #581c87 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #2d5016 0%, #581c87 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

[data-theme="dark"] .btn-success:hover {
    background: linear-gradient(135deg, #15803d 0%, #166534 100%);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-secondary {
    background: linear-gradient(135deg, #4a5a42 0%, #1a2612 100%);
}

[data-theme="dark"] .btn-secondary:hover {
    background: linear-gradient(135deg, #1a2612 0%, #1a2612 100%);
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-outline {
    background: transparent;
    border: 1px solid #4a8c1f;
    color: #4a8c1f;
}

[data-theme="dark"] .btn-outline:hover {
    background: linear-gradient(135deg, #3d6b1e 0%, #6b21a8 100%);
    color: #ffffff;
    transform: translateY(-2px);
}

[data-theme="dark"] .alert {
    border-color: var(--border-color);
}

[data-theme="dark"] .alert-success {
    background: rgba(74, 140, 31, 0.15);
    color: #6abf2a;
}

[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

[data-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #4a8c1f;
}

[data-theme="dark"] table {
    background: var(--card-bg);
}

[data-theme="dark"] th {
    background: var(--bg-tertiary);
    color: #ffffff;
}

[data-theme="dark"] td {
    color: #d0d0d0;
    border-color: var(--border-color);
}

[data-theme="dark"] tr:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .badge {
    color: #ffffff;
}

[data-theme="dark"] ::placeholder {
    color: #606060;
}

/* Strony prawne (cookies, regulamin, polityka) – .legal-page */
[data-theme="dark"] .legal-page h1,
[data-theme="dark"] .legal-page h2,
[data-theme="dark"] .legal-page h3 {
    color: #ffffff !important;
}

[data-theme="dark"] .legal-page .last-updated {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .legal-page h2 {
    border-bottom-color: #2a2a2a !important;
}

[data-theme="dark"] .legal-page p,
[data-theme="dark"] .legal-page li {
    color: #d0d0d0 !important;
}

[data-theme="dark"] .legal-page a {
    color: #6abf2a !important;
}

[data-theme="dark"] .legal-page a:hover {
    color: #86c44a !important;
}

[data-theme="dark"] .legal-page table {
    background: var(--card-bg);
    border-color: #2a2a2a;
}

[data-theme="dark"] .legal-page th,
[data-theme="dark"] .legal-page td {
    border-color: #2a2a2a !important;
    color: #d0d0d0 !important;
}

[data-theme="dark"] .legal-page th {
    background: #252525 !important;
    color: #e5e5e5 !important;
}

[data-theme="dark"] .legal-page td {
    background: #1a1a1a !important;
}

[data-theme="dark"] .legal-page tr:hover td {
    background: #252525 !important;
}

[data-theme="dark"] .back-link {
    color: #6abf2a !important;
}

[data-theme="dark"] .back-link:hover {
    color: #86c44a !important;
}

[data-theme="dark"] .legal-page .cookie-type.required,
[data-theme="dark"] .legal-page .cookie-type.functional {
    background: rgba(74, 140, 31, 0.25) !important;
    color: #86c44a !important;
}

[data-theme="dark"] .legal-page .cookie-type.analytics {
    background: rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .lang-switcher select {
    background: #252525 !important;
    border-color: #333333 !important;
    color: #e5e5e5 !important;
}

/* withdrawal.php – boksy i formularz w dark mode */
[data-theme="dark"] .legal-page .danger {
    background: rgba(220, 38, 38, 0.2) !important;
    border-left-color: #dc2626 !important;
    color: #f0d0d0 !important;
}

[data-theme="dark"] .legal-page .warning {
    background: rgba(245, 158, 11, 0.2) !important;
    border-left-color: #f59e0b !important;
    color: #f5e6c8 !important;
}

[data-theme="dark"] .legal-page .highlight {
    background: rgba(74, 140, 31, 0.2) !important;
    border-left-color: #4a8c1f !important;
    color: #c8e0b8 !important;
}

[data-theme="dark"] .legal-page .form-template {
    background: #252525 !important;
    border-color: #333333 !important;
}

[data-theme="dark"] .legal-page .form-template h3 {
    color: #ffffff !important;
}

[data-theme="dark"] .legal-page .form-template .field label {
    color: #e5e5e5 !important;
}

[data-theme="dark"] .legal-page .form-template .field .placeholder {
    background: #1a1a1a !important;
    border-color: #404040 !important;
    color: #a0a0a0 !important;
}

[data-theme="dark"] .legal-page .form-template p,
[data-theme="dark"] .legal-page .form-template small {
    color: #b0b0b0 !important;
}
