/* ============================================
   CATEGORY PAGE STYLES - Coffee Filters
   Styled according to swiezopalona.pl design system
   Based on producer page styling patterns
   ============================================ */

/* === BASE LAYOUT === */
.category-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

/* === BREADCRUMBS === */
.breadcrumbs {
    font-size: 14px;
    margin-bottom: 20px;
    padding: 10px 0;
    color: #666;
}

.breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #d4a574;
    text-decoration: underline;
}

.breadcrumbs strong {
    color: #333;
    font-weight: 600;
}

/* === CATEGORY HEADER === */
.category-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.category-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #222;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.category-header .subtitle {
    font-size: 18px;
    color: #666;
    font-weight: 400;
    font-style: italic;
    margin: 0 0 20px 0;
}

.category-header .category-intro {
    font-size: 16px;
    line-height: 1.7;
    color: #555;
    margin: 0;
}

/* === CATEGORY DESCRIPTION (Featured intro) === */
.category-description {
    font-size: 18px;
    line-height: 1.7;
    color: #555;
    margin-bottom: 40px;
    padding: 20px;
    background: #f9f9f9;
    border-left: 4px solid #d4a574;
    border-radius: 4px;
}

.category-description p {
    margin: 0 0 15px 0;
}

.category-description p:last-child {
    margin-bottom: 0;
}

/* === FILTER SIDEBAR (if applicable) === */
.filter-sidebar {
    background: #fafafa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.filter-sidebar h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

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

.filter-group h4 {
    font-size: 16px;
    font-weight: 600;
    color: #444;
    margin: 0 0 10px 0;
}

.filter-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.filter-option:hover {
    color: #d4a574;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
}

/* === SORTING & VIEW OPTIONS === */
.category-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #f9f9f9;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-count {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.sorting-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sorting-options label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.sorting-options select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sorting-options select:hover,
.sorting-options select:focus {
    border-color: #d4a574;
    outline: none;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-toggle button {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-toggle button:hover,
.view-toggle button.active {
    background: #d4a574;
    color: white;
    border-color: #d4a574;
}

/* === PRODUCTS GRID === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.product-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #d4a574;
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f9f9f9;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #d4a574;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-brand {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.product-name a {
    color: #222;
    text-decoration: none;
    transition: color 0.3s ease;
}

.product-name a:hover {
    color: #d4a574;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #777;
}

.product-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.product-price {
    font-size: 20px;
    font-weight: 700;
    color: #222;
}

.product-price .currency {
    font-size: 16px;
    font-weight: 400;
    color: #666;
}

.product-cta {
    padding: 8px 16px;
    background: #d4a574;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-cta:hover {
    background: #b8925f;
    transform: translateY(-2px);
}

/* === PRODUCTS LIST VIEW === */
.products-list .product-card {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 20px;
    align-items: center;
}

.products-list .product-image {
    width: 200px;
    padding-top: 0;
    height: 200px;
}

.products-list .product-info {
    padding: 20px 0;
}

.products-list .product-footer {
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-top: none;
}

/* === EDUCATIONAL CONTENT SECTIONS === */
.content-section {
    margin-bottom: 50px;
}

.content-section h2 {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #d4a574;
}

.content-section h3 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 30px 0 15px 0;
}

.content-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: #444;
    margin: 20px 0 10px 0;
}

.content-section p {
    margin: 0 0 15px 0;
    line-height: 1.7;
}

.content-section strong {
    font-weight: 600;
    color: #222;
}

.content-section em {
    font-style: italic;
    color: #555;
}

/* === FILTER TYPES COMPARISON === */
.filter-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.filter-type-card {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.filter-type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.filter-type-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #d4a574;
    font-size: 20px;
}

.filter-type-card .filter-icon {
    font-size: 40px;
    margin-bottom: 15px;
    color: #d4a574;
}

.filter-type-card p {
    margin: 0 0 15px 0;
    font-size: 15px;
    line-height: 1.6;
}

.filter-type-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-type-card li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 8px;
    font-size: 14px;
}

.filter-type-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #d4a574;
    font-weight: bold;
}

/* === BUYING GUIDE BOX === */
.buying-guide {
    background: #fafafa;
    padding: 30px;
    border-left: 4px solid #d4a574;
    border-radius: 4px;
    margin: 40px 0;
}

.buying-guide h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #222;
    font-size: 24px;
}

.buying-guide ul {
    margin: 15px 0;
    padding-left: 25px;
}

.buying-guide li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* === FAQ SECTION === */
.faq-section {
    margin: 50px 0;
}

.faq-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.faq-question {
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.faq-question:hover {
    background: #f9f9f9;
}

.faq-question:after {
    content: "+";
    font-size: 24px;
    color: #d4a574;
    font-weight: 700;
}

.faq-question.active:after {
    content: "−";
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.active {
    padding: 20px;
    max-height: 500px;
}

.faq-answer p {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

/* === LINKS STYLING === */
.content-section a,
.category-description a {
    color: #d4a574;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.content-section a:hover,
.category-description a:hover {
    color: #b8925f;
    border-bottom: 1px solid #b8925f;
}

/* === LISTS === */
.content-section ul {
    margin: 15px 0;
    padding-left: 25px;
}

.content-section li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* === HIGHLIGHTED TIPS === */
.tip-box,
.info-box {
    background: #f0f8ff;
    border-left: 4px solid #4a90e2;
    padding: 20px;
    margin: 25px 0;
    border-radius: 4px;
}

.warning-box {
    background: #fff8f0;
    border-left: 4px solid #f39c12;
    padding: 20px;
    margin: 25px 0;
    border-radius: 4px;
}

.tip-box h4,
.info-box h4,
.warning-box h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* === PAGINATION === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #d4a574;
    color: white;
    border-color: #d4a574;
}

.pagination .current {
    background: #d4a574;
    color: white;
    border-color: #d4a574;
}

.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .disabled:hover {
    background: transparent;
    color: #333;
}

/* === RELATED CATEGORIES === */
.related-categories {
    margin: 50px 0;
}

.related-categories h2 {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    margin: 0 0 30px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #d4a574;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.category-card {
    background: #fafafa;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-card h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #d4a574;
}

.category-card p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
}

.category-card a {
    display: inline-block;
    color: #d4a574;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.category-card a:hover {
    color: #b8925f;
    text-decoration: underline;
}

/* === CTA SECTION === */
.cta-section {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    padding: 40px;
    border-radius: 10px;
    margin: 50px 0;
    text-align: center;
}

.cta-section h2 {
    border-bottom: none;
    margin-bottom: 15px;
}

.cta-section p {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

.btn-primary {
    background: #d4a574;
    color: white;
}

.btn-primary:hover {
    background: #b8925f;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(212, 165, 116, 0.3);
}

.btn-secondary {
    background: white;
    color: #d4a574;
    border: 2px solid #d4a574;
}

.btn-secondary:hover {
    background: #d4a574;
    color: white;
}

/* === FOOTER META === */
.category-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
    text-align: center;
}

.category-footer .last-updated {
    font-size: 14px;
    color: #999;
    font-style: italic;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 25px;
    }
    
    .products-list .product-card {
        grid-template-columns: 150px 1fr;
    }
    
    .products-list .product-image {
        width: 150px;
        height: 150px;
    }
    
    .products-list .product-footer {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .category-page {
        padding: 15px;
    }
    
    .category-header h1 {
        font-size: 28px;
    }
    
    .category-header .subtitle {
        font-size: 16px;
    }
    
    .category-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sorting-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sorting-options select {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .products-list .product-card {
        grid-template-columns: 1fr;
    }
    
    .products-list .product-image {
        width: 100%;
        padding-top: 100%;
        height: auto;
    }
    
    .products-list .product-info {
        padding: 20px;
    }
    
    .filter-comparison {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .content-section h2 {
        font-size: 24px;
    }
    
    .content-section h3 {
        font-size: 20px;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .category-header h1 {
        font-size: 24px;
    }
    
    .content-section h2 {
        font-size: 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .category-description,
    .buying-guide,
    .cta-section {
        padding: 15px;
    }
    
    .product-info {
        padding: 15px;
    }
}

/* === PRINT STYLES === */
@media print {
    .breadcrumbs,
    .category-controls,
    .filter-sidebar,
    .cta-buttons,
    .pagination,
    .view-toggle {
        display: none;
    }
    
    .category-page {
        max-width: 100%;
        padding: 0;
    }
    
    .product-card {
        page-break-inside: avoid;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === ACCESSIBILITY === */
.category-page a:focus,
.btn:focus,
.product-cta:focus,
.sorting-options select:focus,
.faq-question:focus {
    outline: 3px solid #d4a574;
    outline-offset: 2px;
}

.category-page *:focus-visible {
    outline: 2px solid #d4a574;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #d4a574;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-content:focus {
    top: 0;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-section,
.product-card {
    animation: fadeIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.filter-sidebar {
    animation: slideIn 0.5s ease-out;
}

/* === LOADING STATES === */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* === TABLE STYLING === */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background: #f9f9f9;
    font-weight: 600;
    color: #333;
}

tr:hover {
    background: #fafafa;
}

/* === SPECIAL ELEMENTS === */
.content-section code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 14px;
}

.content-section blockquote {
    border-left: 4px solid #d4a574;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
}
