/**
 * Product Category and Single Product Styling
 * - Modern, responsive design
 * - Accessibility enhanced
 * - GIGW 3.0 compliant
 */

/* Category Header Styling */
.tcl-style-header {
    padding: 2rem 0 3rem 0;
    background-color: var(--primary, #4CAF50);
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(44,62,80,0.06);
}

.tcl-style-header.has-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 3.5rem 0 4rem 0;
}

.tcl-style-header.has-bg-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
    z-index: 1;
}

.tcl-style-header .container {
    position: relative;
    z-index: 2;
}

.tcl-breadcrumb {
    margin-bottom: 1.5rem;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.breadcrumb-list li {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.breadcrumb-list li:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumb-list li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s, text-decoration 0.2s;
    padding: 0.25rem;
    border-radius: 4px;
}

.breadcrumb-list li a:hover,
.breadcrumb-list li a:focus {
    color: #fff;
    text-decoration: underline;
    outline: none;
    background-color: rgba(255, 255, 255, 0.1);
}

.breadcrumb-list li.active {
    color: #fff !important;
    font-weight: 500;
}

.breadcrumb-list li.active span,
.breadcrumb-list li.active .tcl-page-title {
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

/* Extra specific rule for breadcrumb active items */
.tcl-style-header .tcl-breadcrumb .breadcrumb-list li.active,
.tcl-style-header .tcl-breadcrumb .breadcrumb-list li.active span,
.tcl-style-header .tcl-breadcrumb .breadcrumb-list li.active .tcl-page-title {
    color: #ffffff !important;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6) !important;
    font-weight: 500 !important;
}

.tcl-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    animation: fadeInUp 0.5s ease-out;
    color: var(--primary, #4CAF50);
}

/* White color only in header contexts */
.tcl-style-header .tcl-page-title,
.breadcrumb-list .tcl-page-title,
.tcl-style-header .breadcrumb-list .tcl-page-title {
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5) !important;
}

/* Dark color in content contexts */
.product-detail-main .tcl-page-title,
.product-categories-main .tcl-page-title,
.category-products-main .tcl-page-title {
    color: var(--primary, #4CAF50) !important;
    text-shadow: none;
}

/* Product title section styling */
.product-title-section .tcl-page-title {
    font-size: 2.2rem;
    margin-bottom: 0.2em;
    flex: 1;
}

.category-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
    max-width: 800px;
    animation: fadeInUp 0.7s ease-out;
}

/* Main Content Styling */
.category-products-main {
    padding: 3rem 0;
    background: var(--section-light, #f8f9fa);
    min-height: 60vh;
}

.back-to-categories {
    margin-bottom: 2rem;
    animation: fadeInLeft 0.5s ease-out;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary, #4CAF50);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.back-link:hover,
.back-link:focus {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--primary-dark, #2E7D32);
    transform: translateX(-3px);
    text-decoration: none;
    outline: none;
}

.back-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.4);
}

.products-count {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary, #555);
}

/* Product Card Styling */
.product-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    animation: fadeInUp 0.5s ease-out;
    min-width: 0;
    word-break: break-word;
}

.product-card:hover,
.product-card:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.product-card:focus-within {
    outline: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(76, 175, 80, 0.3);
}

.product-image-wrapper {
    height: 0;
    padding-top: 66%; /* 3:2 aspect ratio */
    position: relative;
    overflow: hidden;
    background-color: #f1f1f1;
}

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

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

.product-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e9e9e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-placeholder::after {
    content: '\\f1b2';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 2rem;
    color: #ccc;
}

.product-content {
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--heading-primary, #333);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.product-description {
    color: var(--text-secondary, #666);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.product-description p {
    margin: 0;
}

.product-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary, #4CAF50);
    font-weight: 500;
    text-decoration: none;
    margin-top: auto;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.2s, transform 0.2s;
}

.product-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s;
}

.product-link:hover,
.product-link:focus {
    color: var(--primary-dark, #2E7D32);
    transform: translateX(5px);
}

.product-link:hover::after,
.product-link:focus::after {
    width: 100%;
}

.product-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
    border-radius: 4px;
}

/* Pagination Styling */
.pagination {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 5px;
    padding: 0 10px;
    border-radius: 8px;
    background-color: #fff;
    color: var(--text-primary, #333);
    text-decoration: none;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.page-numbers.current {
    background-color: var(--primary, #4CAF50);
    color: #fff;
}

.page-numbers:hover,
.page-numbers:focus {
    background-color: var(--primary-light, #81C784);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.page-numbers.dots:hover {
    background-color: #fff;
    color: var(--text-primary, #333);
    transform: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.page-numbers.prev,
.page-numbers.next {
    padding: 0 15px;
}

/* Empty State Styling */
.no-products-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.no-products-found i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1.5rem;
}

.no-products-found p {
    font-size: 1.25rem;
    color: var(--text-secondary, #666);
    margin-bottom: 1.5rem;
}

.no-products-found .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.2s;
}

.no-products-found .btn:hover,
.no-products-found .btn:focus {
    transform: translateY(-3px);
}

/* Other Categories Section */
.other-categories-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid #e0e0e0;
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--heading-primary, #333);
    position: relative;
    padding-bottom: 0.75rem;
    margin-top: 100px !important;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary, #4CAF50);
    border-radius: 3px;
}

.other-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.category-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.category-image-wrapper {
    height: 0;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    position: relative;
    overflow: hidden;
    background-color: #f1f1f1;
}

.category-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.category-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e9e9e9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-image-placeholder::after {
    content: '\\f07b';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 2rem;
    color: #ccc;
}

.category-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--heading-primary, #333);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.category-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary, #4CAF50);
    font-weight: 500;
    text-decoration: none;
    margin-top: auto;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.2s, transform 0.2s;
}

.category-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: currentColor;
    transition: width 0.3s;
}

.category-link:hover,
.category-link:focus {
    color: var(--primary-dark, #2E7D32);
    transform: translateX(5px);
}

.category-link:hover::after,
.category-link:focus::after {
    width: 100%;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Responsive Adjustments */
@media (max-width: 767px) {
    .tcl-style-header {
        padding: 1.2rem 0 2rem 0;
    }
    
    .tcl-style-header.has-bg-image {
        padding: 2rem 0 2.5rem 0;
    }
    
    .tcl-page-title {
        font-size: 1.75rem;
    }
    
    .category-description {
        font-size: 1rem;
    }
    
    .product-list-grid,
    .other-categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .product-content,
    .category-content {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .tcl-style-header {
        background-color: #fff !important;
        color: #000 !important;
        padding: 1rem 0 !important;
    }
    
    .tcl-page-title {
        color: #000 !important;
        font-size: 24pt !important;
    }
    
    .category-description {
        color: #333 !important;
        font-size: 12pt !important;
    }
    
    .back-to-categories,
    .other-categories-section,
    .product-link,
    .category-link {
        display: none !important;
    }
    
    .product-card,
    .category-card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* High Contrast Mode Overrides (for Accessibility) */
@media (prefers-contrast: more) {
    .tcl-style-header {
        background-color: #000 !important;
    }
    
    .product-card,
    .category-card {
        border: 2px solid #000 !important;
        box-shadow: none !important;
    }
    
    .product-link,
    .category-link,
    .back-link {
        color: #0000EE !important;
        text-decoration: underline !important;
    }
    
    .product-link:visited,
    .category-link:visited,
    .back-link:visited {
        color: #551A8B !important;
    }
    
    .breadcrumb-list li a {
        color: #fff !important;
        text-decoration: underline !important;
    }
}

/* Skip Link for Screen Readers */
.sr-only-focusable:focus,
.sr-only-focusable:active {
    position: absolute;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    clip-path: none;
    z-index: 9999;
    padding: 15px 23px;
    background-color: #fff;
    color: #000;
    text-decoration: none;
    font-weight: 700;
    border: 3px solid #000;
    top: 0;
    left: 0;
}

/* --- Sticky Category Navigation Bar --- */
.sticky-category-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(44,62,80,0.03);
    margin-bottom: 0.5rem;
}
.category-nav-list {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin: 0;
    list-style: none;
    overflow-x: auto;
    white-space: nowrap;
}
.category-nav-list li {
    flex: 0 0 auto;
}
.category-nav-list a {
    display: inline-block;
    padding: 0.5em 1.2em;
    border-radius: 20px;
    background: #f5f5f5;
    color: #234C2A;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.category-nav-list a.active,
.category-nav-list a[aria-current="page"] {
    background: #4CAF50;
    color: #fff;
}
.category-nav-list a:hover,
.category-nav-list a:focus {
    background: #e0f2f1;
    color: #234C2A;
    outline: none;
}

/* --- Hero Overlay & Category Icon --- */
.tcl-style-header .header-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(44,76,42,0.3) 100%);
    z-index: 1;
    pointer-events: none;
}
.tcl-style-header .header-content {
    position: relative;
    z-index: 2;
}
.category-icon {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    line-height: 1;
}

/* --- Product Card Badges & Buttons --- */
.product-image-wrapper {
    position: relative;
}
.badge.new {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #ff9800;
    color: #fff;
    padding: 0.25em 0.9em;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 2;
}
.brochure-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.92);
    color: #d32f2f;
    border-radius: 50px;
    min-width: 2.3em;
    height: 2.3em;
    padding: 0.5em 1em;
    font-size: 1em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: background 0.2s, color 0.2s;
    z-index: 2;
    text-decoration: none;
    white-space: nowrap;
}
.brochure-link .fa-file-pdf {
    font-size: 1.2em;
}
.brochure-link .brochure-text {
    display: inline;
}
.brochure-link:hover, .brochure-link:focus {
    background: #4CAF50;
    color: #fff;
    outline: none;
}
/* Block style for mobile */
.brochure-link--block {
    position: static;
    display: flex;
    width: 100%;
    margin: 0.5rem 0 0 0;
    justify-content: center;
    border-radius: 8px;
    min-width: 0;
    height: auto;
    padding: 0.6em 1em;
}
@media (max-width: 600px) {
    .brochure-link {
        position: static;
        display: flex;
        width: 100%;
        margin: 0.5rem 0 0 0;
        justify-content: center;
        border-radius: 8px;
        min-width: 0;
        height: auto;
        padding: 0.6em 1em;
    }
    .brochure-link .brochure-text {
        display: none;
    }
}
.quick-view-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(255,255,255,0.92);
    color: #234C2A;
    border: none;
    border-radius: 50%;
    width: 2.3em;
    height: 2.3em;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}
.quick-view-btn:hover, .quick-view-btn:focus {
    background: #4CAF50;
    color: #fff;
    outline: none;
}

/* --- Skeleton Loader --- */
.product-card.skeleton {
    background: #f3f3f3;
    min-height: 320px;
    border-radius: 10px;
    box-shadow: none;
    position: relative;
    overflow: hidden;
    animation: skeleton-pulse 1.2s infinite ease-in-out;
}
.product-card.skeleton::before {
    content: '';
    display: block;
    height: 180px;
    background: #e0e0e0;
    border-radius: 10px 10px 0 0;
    margin-bottom: 1.2rem;
}
.product-card.skeleton::after {
    content: '';
    display: block;
    height: 1.2rem;
    width: 80%;
    background: #e0e0e0;
    border-radius: 6px;
    margin: 1rem auto 0.5rem auto;
}
@keyframes skeleton-pulse {
    0% { background: #f3f3f3; }
    50% { background: #ececec; }
    100% { background: #f3f3f3; }
}

/* --- Quick View Modal --- */
.quick-view-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}
.quick-view-modal[style*="display: block"] {
    display: flex;
}
.quick-view-content {
    background: #fff;
    border-radius: 12px;
    max-width: 380px;
    width: 100%;
    padding: 1.2rem 1rem 1rem 1rem;
    position: relative;
    box-shadow: 0 8px 32px rgba(44,62,80,0.18);
    animation: fadeInUp 0.3s;
    font-size: 1rem;
}
#quick-view-img {
    max-width: 220px;
    max-height: 180px;
    margin: 0 auto 1rem auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
#quick-view-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}
#quick-view-desc {
    font-size: 0.98rem;
    color: #444;
    margin-bottom: 0.5rem;
    text-align: center;
}
.quick-view-close {
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.5rem;
}
@media (max-width: 767px) {
    .quick-view-content {
        max-width: 98vw;
        padding: 0.7rem 0.3rem 0.7rem 0.3rem;
        font-size: 0.97rem;
    }
    #quick-view-img {
        max-width: 98vw;
        max-height: 120px;
    }
    #quick-view-title {
        font-size: 1rem;
    }
    #quick-view-desc {
        font-size: 0.95rem;
    }
}

/* --- Responsive for Sticky Nav & Modal --- */
@media (max-width: 767px) {
    .sticky-category-nav {
        top: 56px;
        font-size: 0.97em;
    }
    .category-nav-list {
        padding: 0.5rem 0.5rem;
        gap: 0.25rem;
    }
    .quick-view-content {
        max-width: 98vw;
        padding: 1.2rem 0.5rem 1rem 0.5rem;
    }
} 