:root {
    --bg-color: #fafafa;
    --text-main: #1a1a1a;
    --text-muted: #6b7280;
    --primary-orange: #ff9500;
    --hover-orange: #e68600;
    --border-color: #e5e7eb;
    --search-bg: #f9fafb;
    --font-main: 'Outfit', sans-serif;
    --icon-color: #4b5563;
    --logo-color: #1a1a1a;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --card-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
/* Header */
.main-header {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: none;
}

.site-logo {
    max-height: 48px;
    display: block;
}

.top-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-nav a {
    font-size: 20px;
    color: var(--icon-color);
    transition: color 0.2s;
}

.top-nav a[title="User"] {
    font-size: 15px;
}

.top-nav a:hover {
    color: black;
}

.lang-icon {
    font-size: 14px !important;
    font-weight: 700;
    border: 2px solid var(--icon-color);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sub Header / Search */
.sub-header {
    background: white;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.search-wrapper {
    display: flex;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    align-items: center;
    padding: 0;
    max-width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrapper:focus-within {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.1);
}

.search-scope-select {
    padding: 14px 20px;
    border-right: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    background: var(--search-bg);
    border: none;
    border-radius: 8px 0 0 8px;
    outline: none;
    height: 100%;
    appearance: none;
    transition: background 0.2s;
}

.search-scope-select:hover {
    background: #f3f4f6;
}

#global-search {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 20px;
    font-size: 15px;
    outline: none;
    color: var(--text-main);
}

#global-search::placeholder {
    color: var(--text-muted);
}

.search-btn {
    background: transparent;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 18px;
    color: var(--icon-color);
    transition: color 0.2s;
}

.search-btn:hover {
    color: var(--primary-orange);
}

/* Filters */
.filters-row {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
    background: white;
}

.filters-row .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-group {
    display: flex;
    gap: 15px;
    /* Add spacing back */
}

.filter-select,
.filter-btn {
    padding: 12px 24px;
    /* Bigger padding */
    border: none;
    border-radius: 8px !important;
    /* Full rounded corners always */
    font-weight: 500;
    font-family: var(--font-main);
    cursor: pointer;
    font-size: 16px;
    /* Larger font */
    outline: none;
    transition: all 0.2s ease;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 48px;
    /* Fixed height for consistency */
}

/* Specific Orange Style */
.filter-select.orange,
.filter-btn.orange {
    background-color: #FFBA00;
    color: white;
    /* White text */
}

.filter-select.orange:hover,
.filter-btn.orange:hover {
    background-color: #e0a300;
    /* Darker shade for hover */
}

/* Customize Select Arrow to be White */
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
    /* Make space for arrow */
}

.filter-select.gray,
.filter-btn.gray {
    background-color: #eee;
    color: #555;
}

.filter-btn.gray:hover {
    background-color: #ddd;
}

.sort-dropdown {
    font-size: 14px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    /* Generous spacing */
    padding-bottom: 40px;
}

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: transparent;
}

/* File Badge */
.file-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.card-image-wrapper {
    position: relative;
    height: 260px;
    /* Taller image area */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    padding: 20px;
    /* Padding inside wrapper */
    background: #fff;
    /* Ensure white bg behind transparent images */
    border-radius: 8px 8px 0 0;
}

.card-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .card-image {
    transform: scale(1.05);
    /* Zoom effect */
}

/* Hover Actions */
.card-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    /* Hidden by default */
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.product-card:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(108, 117, 125, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Pagination */
#pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    padding-bottom: 50px;
}

.pagination.custom-pagination {
    display: flex;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    background: white;
    box-shadow: none;
    /* Reset overrides */
}

/* Ensure no gaps between buttons */
.pagination.custom-pagination button {
    margin: 0;
}

.page-btn,
.page-ellipsis {
    background: white;
    border: none;
    border-right: 1px solid #dee2e6;
    color: #007bff;
    /* Blue text default */
    padding: 0 16px;
    /* Adjusted padding */
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    line-height: 42px;
    /* Center text vertically */
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    /* Force no rounded corners on buttons */
}

.page-btn:last-child {
    border-right: none;
}

.page-btn:hover:not(.active):not(:disabled) {
    background-color: #e9ecef;
    color: #0056b3;
}

.page-btn.active {
    background-color: #17A2B8 !important;
    /* Teal Color Force */
    color: white !important;
    border-color: #17A2B8 !important;
    z-index: 1;
    /* Bring to front */
}

.page-btn:disabled {
    color: #6c757d;
    cursor: not-allowed;
    background: white;
}

.page-btn.prev-btn,
.page-btn.next-btn {
    padding: 0 20px;
    gap: 8px;
    /* Space between icon and text */
}

/* Specific fix for ellipsis alignment */
.page-ellipsis {
    cursor: default;
    color: #6c757d;
    border-radius: 0 !important;
}

.card-body {
    padding: 0 15px 15px 15px;
    /* Add padding to body */
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-date {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 50px;
}

/* Old pagination override - Remove conflicts */
/* .page-btn styles removed/commented */

.page-ellipsis {
    padding: 0 8px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

/* Modal */
.hidden {
    display: none !important;
}

#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

#modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 900px;
    max-width: 95%;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

#modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    color: #555;
    transition: color 0.2s;
}

#modal-close:hover {
    color: black;
}

/* Modal Product Detail */
.modal-product-detail {
    display: flex;
    gap: 30px;
}

.modal-image-col {
    flex: 1.2;
    background: #f9f9f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-image-col img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 4px;
}

.modal-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.modal-badge {
    background: #333;
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.modal-date {
    font-size: 12px;
    color: #888;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-main);
    line-height: 1.2;
}

.modal-code {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 25px;
}

.modal-info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #333;
}

.info-row strong {
    font-weight: 600;
    color: #555;
    margin-right: 8px;
    min-width: 70px;
    display: inline-block;
}

/* Modal Size List */
.modal-size-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.size-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 15px 25px;
    border-radius: 50px;
    /* Fully rounded pill shape */
    gap: 20px;
}

.size-label {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
    width: 80px;
    flex-shrink: 0;
}

.size-dim {
    font-size: 15px;
    color: #555;
    flex: 1;
}

.size-meta {
    font-size: 14px;
    color: #777;
    margin-right: 20px;
}

.size-dl-btn {
    background: #343a40;
    /* Dark button */
    color: white;
    padding: 8px 30px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.size-dl-btn:hover {
    background: #212529;
}

.size-cart-btn {
    background: transparent;
    border: none;
    color: #444;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 12px;
}

.size-cart-btn:hover {
    color: black;
}

.modal-meta {
    border-top: 1px solid #eee;
    padding-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meta-item {
    font-size: 13px;
    color: #555;
    display: flex;
    gap: 10px;
}

/* Profile Page */
.page-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-main);
}

.profile-layout {
    display: flex;
    gap: 40px;
    margin-top: 20px;
}

.profile-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.profile-menu {
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
}

.profile-menu-item {
    display: block;
    padding: 12px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    transition: all 0.2s;
}

.profile-menu-item:last-child {
    border-bottom: none;
}

.profile-menu-item:hover {
    background: #f9f9f9;
    color: var(--text-main);
}

.profile-menu-item.active {
    background: #007bff;
    /* Blue as in image */
    color: white;
}

.profile-content {
    flex: 1;
}

.section-title {
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 15px;
    color: var(--text-main);
}

.cart-table-container {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-main);
    text-transform: uppercase;
}

.empty-cart-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-main);
    border: 1px solid #eee;
    border-top: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.empty-cart-state i {
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-cart-state p {
    font-weight: 400;
}

/* Files Page */
.files-container {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 50px;
}

.files-header {
    margin-bottom: 20px;
}

.files-list {
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background-color: #f9f9f9;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-icon {
    font-size: 24px;
    color: var(--primary-orange);
    width: 30px;
    display: flex;
    justify-content: center;
}

.file-name {
    font-weight: 500;
    color: var(--text-main);
}

.file-dl-btn {
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-dl-btn:hover {
    background: #e0e0e0;
}