/* Body background force if _Layout doesn't handle it for this page */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
}

.product-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    color: var(--text-main); 
    font-family: inherit;
}

.product-header {
    text-align: center;
    margin-bottom: 40px;
}

.product-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-main);
    border-bottom: none;
    padding-bottom: 0;
}

.product-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

.product-filters {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
    gap: 24px;
    width: 100%;
}

.search-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

#productSearch {
    width: 100%;
    padding: 16px 40px 16px 50px;
    border-radius: 8px;
    border: 1px solid var(--border-color) !important;
    background-color: var(--bg-search) !important;
    color: var(--text-search) !important;
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s ease;
}

#productSearch::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

#productSearch:focus {
    border-color: var(--bg-btn-active) !important;
    box-shadow: 0 0 0 2px rgba(63, 81, 181, 0.3);
}

/* ── Search clear button ───────────────────────────────────── */
.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%) scale(0.5);
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, color 0.2s, background 0.2s;
}
.search-clear-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}
.search-clear-btn:hover {
    color: var(--text-main);
    background: none;
    border: none;
    outline: none;
    box-shadow: none;
}

.category-filters-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.cat-btn {
    background-color: transparent;
    color: var(--text-btn);
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: none !important;
    letter-spacing: normal;
    transition: all 0.3s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cat-btn:hover {
    background-color: var(--bg-btn-hover);
    border-color: var(--bg-btn-hover);
    color: var(--text-btn-hover);
}

.cat-btn.active {
    background-color: var(--bg-btn-active);
    color: var(--text-btn-active);
    border-color: var(--bg-btn-active);
}

.paginated-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.prod-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    height: 100%;
    position: relative;
}

.prod-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.75rem;
    padding: 4px 12px;
    background-color: var(--bg-btn-active);
    color: var(--text-btn-active);
    border-radius: 12px;
    font-weight: 500;
}

.prod-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-hover);
    text-decoration: none;
}

.prod-icon {
    margin-bottom: 16px;
    height: 48px;
    display: flex;
    align-items: center;
}

.prod-icon img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.prod-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
    color: var(--text-main);
}

.prod-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    flex-grow: 1;
    white-space: pre-line;
    /* Simple clamp */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.prod-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.prod-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 12px;
}

/* Product Count */
.product-count {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* Pagination Buttons */
.product-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.page-btn {
    background-color: var(--bg-card);
    color: var(--text-btn);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--bg-btn-hover);
    border-color: var(--bg-btn-hover);
    color: var(--text-btn-hover);
}

.page-btn.active {
    background-color: var(--bg-btn-active);
    color: var(--text-btn-active);
    border-color: var(--bg-btn-active);
    font-weight: bold;
    cursor: default;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom scrollbar for layout */
.product-page-container::-webkit-scrollbar {
    width: 8px;
}
.product-page-container::-webkit-scrollbar-track {
    background: var(--bg-body);
}
.product-page-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.product-page-container::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

.hidden {
    display: none !important;
}

/* ── Modern Circular Loader ────────────────────────────────── */
.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
    padding: 3rem 0;
    grid-column: 1 / -1;
}

.loader-circle {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(155, 241, 255, 0.2);
    border-radius: 50%;
    border-top-color: #9bf1ff;
    animation: spin 1s ease-in-out infinite;
    -webkit-animation: spin 1s ease-in-out infinite;
    position: relative;
    box-shadow: 0 0 15px rgba(155, 241, 255, 0.1);
}

.loader-circle::before {
    content: '';
    position: absolute;
    top: -3px; left: -3px; right: -3px; bottom: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: rgba(155, 241, 255, 0.4);
    animation: spin 2s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@-webkit-keyframes spin {
    to { -webkit-transform: rotate(360deg); }
}

/* Light theme adjustments */
body.light-theme .loader-circle {
    border-color: rgba(63, 81, 181, 0.1);
    border-top-color: var(--bg-btn-active);
    box-shadow: none;
}
body.light-theme .loader-circle::before {
    border-top-color: rgba(63, 81, 181, 0.2);
}


