/* ========================================
   WordPlay — Main Stylesheet
   ======================================== */

:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #E8E5FF;
    --accent: #FFCA28;
    --accent-orange: #FF6F00;
    --success: #C8E6C9;
    --success-dark: #4CAF50;
    --danger: #D32F2F;
    --score-orange: #E65100;

    --bg-gradient-start: rgba(108, 99, 255, 0.08);
    --bg-gradient-end: #F8F6FF;
    --card-bg: #FFFFFF;
    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8b8da3;
    --border-color: rgba(108, 99, 255, 0.12);

    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-btn: 14px;
    --shadow-sm: 0 2px 8px rgba(108, 99, 255, 0.08);
    --shadow-md: 0 4px 20px rgba(108, 99, 255, 0.12);
    --shadow-lg: 0 8px 40px rgba(108, 99, 255, 0.15);

    --font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    --transition: all 0.2s ease;
}

/* ── Reset & Base ── */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

main, .main-content {
    flex: 1;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* ── Navbar ── */
.wp-navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    z-index: 1030;
}

.wp-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wp-navbar .navbar-brand .navbar-logo {
    height: 50px;
    width: auto;
}

.wp-navbar .navbar-brand img {
    height: 50px;
    width: auto;
}

/* Colorful brand text */
.brand-text {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.brand-w { color: #6C63FF; }
.brand-o { color: #FF6B6B; }
.brand-r { color: #FFCA28; }
.brand-d { color: #4ECDC4; }
.brand-p { color: #6C63FF; }
.brand-l { color: #FF6F00; }
.brand-a { color: #A18CD1; }
.brand-y { color: #4facfe; }

.wp-navbar .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.wp-navbar .nav-link:hover,
.wp-navbar .nav-link:focus {
    color: var(--primary);
    background: var(--primary-light);
}

.wp-navbar .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

.wp-navbar .nav-icon-btn {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    background: transparent;
    transition: var(--transition);
    position: relative;
    padding: 0;
}

.wp-navbar .nav-icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.wp-navbar .cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-navbar .navbar-toggler {
    border: 1.5px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.4rem 0.6rem;
}

.wp-navbar .navbar-toggler:focus {
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Cards ── */
.wp-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
}

.wp-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.wp-card .card-body {
    padding: 1.25rem;
}

.wp-card .card-img-top {
    object-fit: contain;
    max-height: 220px;
    padding: 1rem;
    background: #fafafe;
}

/* ── Buttons ── */
.btn-wp-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-btn);
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-wp-primary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

.btn-wp-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--border-radius-btn);
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-wp-secondary:hover {
    background: var(--primary);
    color: white;
}

.btn-wp-accent {
    background: var(--accent);
    color: var(--text-primary);
    border: none;
    border-radius: var(--border-radius-btn);
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    transition: var(--transition);
}

.btn-wp-accent:hover {
    background: #ffb300;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 202, 40, 0.4);
}

.btn-wp-danger {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: var(--border-radius-btn);
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    transition: var(--transition);
}

.btn-wp-danger:hover {
    background: #b71c1c;
    color: white;
}

.btn-wp-success {
    background: var(--success-dark);
    color: white;
    border: none;
    border-radius: var(--border-radius-btn);
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    transition: var(--transition);
}

.btn-wp-success:hover {
    background: #388E3C;
    color: white;
}

/* ── Forms ── */
.form-control, .form-select {
    border-radius: var(--border-radius-sm);
    border: 1.5px solid var(--border-color);
    padding: 0.65rem 1rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* ── Alerts ── */
.alert {
    border-radius: var(--border-radius-sm);
    border: none;
    font-weight: 500;
}

/* ── Hero Section ── */
.wp-hero {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--primary-light) 50%, var(--bg-gradient-end) 100%);
    padding: 5rem 2rem;
    text-align: center;
    border-radius: 0 0 2rem 2rem;
    margin-bottom: 3rem;
}

.wp-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.wp-hero .tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* ── Feature Cards ── */
.wp-feature-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    height: 100%;
}

.wp-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.wp-feature-card .emoji {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.wp-feature-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.wp-feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Product Cards ── */
.wp-product-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wp-product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.wp-product-card .product-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 1rem;
    background: linear-gradient(135deg, #fafafe 0%, var(--primary-light) 100%);
}

.wp-product-card .card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wp-product-card .product-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.wp-product-card .product-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    flex: 1;
}

/* ── Info Boxes (konto) ── */
.info-box {
    background: #f8f7ff;
    border-radius: var(--border-radius-sm);
    padding: 0.875rem 1rem;
    height: 100%;
}

.info-box .label-muted {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.info-box .value-strong {
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 0.25rem;
}

/* ── Konto Card ── */
.konto-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.konto-sidebar .list-group-item {
    border: none;
    border-radius: var(--border-radius-sm) !important;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.konto-sidebar .list-group-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.konto-sidebar .list-group-item.active {
    background: var(--primary);
    color: white;
    border-color: transparent;
}

/* ── Footer ── */
.wp-footer {
    background: var(--text-primary);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
}

.wp-footer h5 {
    color: white;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.wp-footer a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.wp-footer a:hover {
    color: var(--accent);
}

.wp-footer .footer-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.wp-footer .footer-brand img {
    height: 44px;
    width: auto;
}

.wp-footer .footer-brand .brand-text {
    font-size: 1.3rem;
}

.wp-footer .footer-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 300px;
}

.wp-footer .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wp-footer .footer-links li {
    margin-bottom: 0.5rem;
}

.wp-footer .footer-links a {
    font-size: 0.9rem;
}

.wp-footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.wp-footer .social-links {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.wp-footer .social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.wp-footer .social-links a:hover {
    background: var(--primary);
    color: white;
}

/* ── Category Pills ── */
.wp-category-pills .nav-link {
    border-radius: 50px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: white;
    border: 1.5px solid var(--border-color);
    transition: var(--transition);
}

.wp-category-pills .nav-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.wp-category-pills .nav-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ── Content Section ── */
.wp-section {
    padding: 2.5rem 0;
}

.wp-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.wp-section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* ── Divider ── */
.wp-divider {
    border: none;
    height: 4px;
    width: 60px;
    background: var(--primary);
    border-radius: 2px;
    margin: 2rem auto;
    opacity: 1;
}

/* ── Utilities ── */
.text-wp-primary { color: var(--primary) !important; }
.text-wp-accent { color: var(--accent) !important; }
.bg-wp-primary-light { background: var(--primary-light) !important; }

/* ── Nav pills override for category nav ── */
.nav-pills .nav-link.active {
    background-color: var(--primary);
}

/* ── Badge overrides ── */
.badge.bg-wp-primary {
    background: var(--primary) !important;
}

/* ── Fixed Leaflet Carousel ── */
.wp-leaflet-carousel-wrapper {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.wp-leaflet-carousel .carousel-inner {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.wp-leaflet-carousel .carousel-item img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    background: white;
    border-radius: var(--border-radius);
}

.wp-leaflet-carousel .carousel-control-prev,
.wp-leaflet-carousel .carousel-control-next {
    width: 44px;
    height: 44px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.9;
    transition: var(--transition);
}

.wp-leaflet-carousel .carousel-control-prev {
    left: -22px;
}

.wp-leaflet-carousel .carousel-control-next {
    right: -22px;
}

.wp-leaflet-carousel .carousel-control-prev:hover,
.wp-leaflet-carousel .carousel-control-next:hover {
    opacity: 1;
    background: var(--primary-dark);
    transform: translateY(-50%) scale(1.1);
}

.wp-leaflet-carousel .carousel-control-prev-icon,
.wp-leaflet-carousel .carousel-control-next-icon {
    width: 16px;
    height: 16px;
}

.wp-leaflet-carousel .carousel-indicators {
    bottom: -30px;
}

.wp-leaflet-carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 2px solid var(--primary);
    opacity: 0.5;
}

.wp-leaflet-carousel .carousel-indicators button.active {
    background: var(--primary);
    opacity: 1;
}

/* Layout for pages with carousel on left */
.wp-leaflet-page {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.wp-leaflet-left {
    position: sticky;
    top: 90px;
    width: 45%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
}

.wp-leaflet-right {
    width: 55%;
    padding: 1rem 0;
}

@media (max-width: 991.98px) {
    .wp-leaflet-carousel-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 0 auto 2rem;
        padding: 0 1rem;
    }

    .wp-leaflet-left {
        display: none;
    }

    .wp-leaflet-right {
        width: 100%;
        padding: 1rem;
    }

    .wp-leaflet-carousel .carousel-control-prev {
        left: 8px;
    }

    .wp-leaflet-carousel .carousel-control-next {
        right: 8px;
    }
}

/* ── Responsive ── */

/* Tablet (md) */
@media (max-width: 991.98px) {
    .wp-hero {
        padding: 3rem 1.5rem;
        border-radius: 0 0 1rem 1rem;
    }
    .wp-hero h1 {
        font-size: 1.75rem;
    }
    .wp-hero .tagline {
        font-size: 1.05rem;
    }

    .wp-navbar .navbar-nav {
        padding: 1rem 0;
        gap: 0.25rem;
    }
    .wp-navbar .nav-link {
        padding: 0.75rem 1rem;
        font-size: 1rem;
        border-radius: var(--border-radius-sm);
    }
    .wp-navbar .navbar-brand .navbar-logo,
    .wp-navbar .navbar-brand img {
        height: 40px;
    }
    .brand-text {
        font-size: 1.2rem;
    }

    .wp-section {
        padding: 2rem 0;
    }
    .wp-section-title {
        font-size: 1.3rem;
    }

    .wp-feature-card {
        padding: 1.5rem 1rem;
    }

    /* Footer stacked */
    .wp-footer {
        padding: 2rem 0 1rem;
    }
    .wp-footer .footer-desc {
        max-width: 100%;
    }
}

/* Mobile (sm and below) */
@media (max-width: 575.98px) {
    /* General */
    body {
        font-size: 0.9rem;
    }

    .main-content {
        padding-top: 70px !important;
    }

    /* Hero */
    .wp-hero {
        padding: 2rem 1rem;
        margin-bottom: 1.5rem;
        border-radius: 0;
    }
    .wp-hero h1 {
        font-size: 1.35rem;
        line-height: 1.3;
    }
    .wp-hero .tagline {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    .wp-hero img {
        max-width: 120px !important;
    }
    .wp-hero .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    /* Navbar */
    .wp-navbar {
        padding: 0.5rem 0;
    }
    .wp-navbar .navbar-brand .navbar-logo,
    .wp-navbar .navbar-brand img {
        height: 34px;
    }
    .brand-text {
        font-size: 1.1rem;
    }
    .wp-navbar .nav-link {
        padding: 0.8rem 1rem;
        font-size: 1.05rem;
        border-bottom: 1px solid var(--border-color);
    }
    .wp-navbar .nav-link:last-child {
        border-bottom: none;
    }
    .wp-navbar .nav-icon-btn {
        width: 38px;
        height: 38px;
    }

    /* Cards */
    .wp-card {
        border-radius: var(--border-radius-sm);
    }
    .wp-card .card-body,
    .wp-card.p-4,
    .wp-card.p-5 {
        padding: 1.25rem !important;
    }

    /* Product cards */
    .wp-product-card .product-img {
        height: 160px;
        padding: 0.75rem;
    }
    .wp-product-card .card-body {
        padding: 1rem;
    }

    /* Feature cards */
    .wp-feature-card {
        padding: 1.25rem 1rem;
    }
    .wp-feature-card .emoji {
        font-size: 2rem;
    }
    .wp-feature-card h3 {
        font-size: 1rem;
    }
    .wp-feature-card p {
        font-size: 0.85rem;
    }

    /* Category pills */
    .wp-category-pills .nav-link {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
    }

    /* Sections */
    .wp-section {
        padding: 1.5rem 0;
    }
    .wp-section-title {
        font-size: 1.2rem;
    }
    .wp-section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    /* Section title in cards */
    .section-title {
        font-size: 1.4rem;
    }
    .section-subtitle {
        font-size: 0.85rem;
    }

    /* Buttons */
    .btn-wp-primary,
    .btn-wp-secondary,
    .btn-wp-accent,
    .btn-wp-success {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }
    .btn-lg {
        padding: 0.7rem 1.5rem !important;
        font-size: 1rem !important;
    }

    /* Forms */
    .form-control, .form-select {
        padding: 0.6rem 0.85rem;
        font-size: 0.9rem;
    }

    /* Footer */
    .wp-footer {
        padding: 2rem 0 1rem;
        text-align: center;
    }
    .wp-footer .footer-brand {
        justify-content: center;
    }
    .wp-footer .footer-desc {
        max-width: 100%;
        margin: 0 auto;
    }
    .wp-footer .social-links {
        justify-content: center;
    }
    .wp-footer h5 {
        margin-top: 1.5rem;
    }

    /* Koszyk table */
    .table {
        font-size: 0.85rem;
    }
    .table th, .table td {
        padding: 0.5rem 0.35rem;
    }

    /* Cennik in shop */
    .cennik-img {
        max-width: 100% !important;
    }

    /* Login/Register card */
    .wp-card.p-md-5 {
        padding: 1.25rem !important;
    }

    /* Divider */
    .wp-divider {
        margin: 1.5rem auto;
    }

    /* Carousel on mobile */
    .wp-leaflet-carousel .carousel-control-prev,
    .wp-leaflet-carousel .carousel-control-next {
        width: 36px;
        height: 36px;
    }
    .wp-leaflet-carousel .carousel-control-prev-icon,
    .wp-leaflet-carousel .carousel-control-next-icon {
        width: 14px;
        height: 14px;
    }

    /* Konto page */
    .konto-card {
        border-radius: var(--border-radius-sm);
    }
    .konto-sidebar .list-group-item {
        padding: 0.6rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Info boxes */
    .info-box {
        padding: 0.75rem;
    }
    .info-box .label-muted {
        font-size: 0.7rem;
    }
    .info-box .value-strong {
        font-size: 0.9rem;
    }
}

/* Extra small (very narrow phones) */
@media (max-width: 374.98px) {
    .wp-hero h1 {
        font-size: 1.2rem;
    }
    .brand-text {
        font-size: 0.95rem;
    }
    .wp-navbar .navbar-brand img {
        height: 28px;
    }
    .wp-category-pills .nav-link {
        padding: 0.35rem 0.7rem;
        font-size: 0.8rem;
    }
}
