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

a {
    text-decoration: none !important;
    color: var(--accent);
    transition: color var(--transition);
}

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

body {
    font-family: var(--font-body);
    line-height: 1.65;
    background-color: var(--bg-primary);
    background-image: radial-gradient(ellipse at 20% 0%, rgba(59,130,246,0.06) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 100%, rgba(59,130,246,0.04) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
}

html.dark body {
    background-image: radial-gradient(ellipse at 20% 0%, rgba(59,130,246,0.08) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 100%, rgba(59,130,246,0.05) 0%, transparent 60%);
    background-attachment: fixed;
}

.container { margin: 4% auto; }

/* ─── TITLE WRAPPER ─── */
.title-wrapper {
    padding: 10px 0;
    margin-bottom: 32px;
}

.title-wrapper h1 {
    font-family: var(--font-head);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--text-primary);
}

.title-wrapper h6 {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    margin-top: 8px;
}

/* ─── CATEGORY GRID ─── */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

@media (max-width: 576px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}

@media (max-width: 992px) {
    .parts-layout { grid-template-columns: 1fr; }
    .brand-sidebar { position: static !important; margin-bottom: 30px; }
}

/* ─── PREMIUM IMAGE CARD ─── */
.category-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    transition: transform 0.35s cubic-bezier(0.34,1.30,0.64,1),
                box-shadow 0.35s ease;
    cursor: pointer;
    /* Fixed aspect ratio so ALL cards look identical regardless of image */
    aspect-ratio: 4 / 3;
}

.category-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0,0,0,0.22), 0 4px 16px rgba(59,130,246,0.18);
}

/* The anchor fills the card completely */
.category-card a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    color: inherit;
    text-decoration: none;
}

/* Image fills card 100% — background-size: cover handles any source ratio */
.category-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--bg-secondary);
    transition: transform 0.55s cubic-bezier(0.25,0.46,0.45,0.94);
}

.category-card:hover .category-img {
    transform: scale(1.08);
}

/* Gradient overlay sits above image, below text */
.category-card a::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(5, 8, 20, 0.85) 0%,
        rgba(5, 8, 20, 0.35) 45%,
        transparent 100%
    );
    transition: opacity 0.35s ease;
    z-index: 1;
}

.category-card:hover a::after {
    background: linear-gradient(
        to top,
        rgba(5, 8, 20, 0.92) 0%,
        rgba(5, 8, 20, 0.50) 50%,
        rgba(59, 130, 246, 0.12) 100%
    );
}

/* Text pinned to the bottom over the gradient */
.category-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 18px 18px;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
}

.category-card h3 {
    font-family: var(--font-head);
    font-size: clamp(0.9rem, 2vw, 1.05rem);
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.25;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
    flex: 1;
}

/* Arrow chevron that appears on hover */
.category-text::after {
    content: '';
    display: block;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.category-card:hover .category-text::after {
    opacity: 1;
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Ghost loading placeholder */
html:not(.dark) .category-img {
    background-color: #d8dce8;
}

.category-card p { display: none; }

/* ─── BOOTSTRAP CARD OVERRIDE ─── */
.card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-card) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-card) !important;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition) !important;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
    z-index: 1;
}

.card:hover {
    transform: translateY(-4px) !important;
    border-color: var(--border-accent) !important;
    box-shadow: var(--shadow-hover) !important;
}

.card:hover::before { transform: scaleX(1); }

.card-title {
    font-family: var(--font-head);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary) !important;
    text-align: center;
}

.card-body {
    padding: 16px 0 0 !important;
    margin-top: 10px;
}

.card-body p {
    margin: 4px 0;
    color: var(--text-secondary);
}

/* ─── ACCORDION ─── */
.accordion {
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.accordion-item {
    background: var(--bg-card);
    border: none;
    border-bottom: 1px solid var(--border-subtle);
}

.accordion-button {
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.9rem;
}

.accordion-button:not(.collapsed) {
    background: var(--accent-dim);
    color: var(--accent);
    box-shadow: none;
}

.accordion-button::after {
    filter: var(--accordion-arrow-filter, none);
}

html.dark .accordion-button::after {
    filter: invert(1);
}

.list-group-item {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--text-primary);
    transition: background var(--transition);
}

.list-group-item:hover { background: var(--accent-dim); }

.list-group-item a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.list-group-item:hover a { color: var(--accent); }

/* ─── MODAL ─── */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7);
    overflow: auto;
}

.modal-dialog { max-width: 800px; margin: auto; }

.modal-content {
    position: relative;
    background-color: var(--bg-elevated);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
}

.modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.close {
    position: absolute;
    top: 0; right: 5px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
}

.close:hover { color: var(--text-primary); }

.modal-main-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.thumbnail-image {
    width: 80px; height: 80px;
    cursor: pointer;
    margin: 5px;
    border: 2px solid var(--border-subtle);
    object-fit: cover;
    border-radius: 2px;
    transition: border-color var(--transition);
}

.thumbnail-image:hover { border-color: var(--accent); }

.main-image {
    width: 100%; height: 400px;
    object-fit: cover;
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
}

/* ─── PART INFO ─── */
.part-info {
    border: 1px solid var(--border-card);
    border-radius: var(--radius);
    padding: 8px 14px;
    background: var(--bg-card);
}

.part-info h5 {
    font-size: 0.875rem;
    font-weight: 400;
    text-align: left;
    color: var(--text-secondary);
}

.part-info h5:nth-child(1) {
    margin-bottom: 10px;
    font-weight: 700;
    font-size: 1.05rem;
    text-align: center;
    color: var(--text-primary);
}

/* ─── CAROUSEL ─── */
.carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    margin: 20px 0;
}

.carousel-track { display: flex; }

.carousel-item-costum {
    position: relative;
    flex: 0 0 20%;
    box-sizing: border-box;
    padding: 10px;
}

.carousel-item-costum img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius);
}

.carousel-caption {
    background-color: rgba(0,0,0,0.55);
    color: #fff;
    padding: 8px;
    border-radius: 0 0 var(--radius) var(--radius);
    text-align: center;
    margin-top: 0;
    position: absolute;
    bottom: 10px; left: 10px; right: 10px;
}

.carousel-caption h5 {
    font-size: 0.8rem;
    color: #fff;
    font-family: var(--font-head);
}

.brand-image {
    width: 25px; height: 25px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 50%;
}


@media screen and (max-width: 768px) {
    .carousel-item-costum { flex: 0 0 50%; }
}

/* ─── PART CARD V2 ─── */
.part-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.part-card-img-container {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-color: var(--bg-secondary);
    border-radius: 4px 4px 0 0;
    flex-shrink: 0;
    transition: background-color var(--transition);
}


/* -- SALE CAROUSEL -- */
.sale-carousel-section {
    margin: 60px 0;
    position: relative;
}
.sale-title {
    font-family: var(--font-head);
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sale-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--accent), transparent);
}
.sale-carousel-container {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius);
    background: rgba(var(--accent-rgb), 0.05);
    padding: 20px;
    border: 1px solid rgba(var(--accent-rgb), 0.1);
}
.sale-carousel-wrapper {
    display: flex;
    transition: transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);
}
.sale-card {
    flex: 0 0 calc(25% - 20px);
    margin-right: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.3s;
    text-decoration: none;
    color: inherit;
}
.sale-card:hover {
    transform: translateY(-5px);
    color: inherit;
}
.sale-card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
}
.sale-card-info {
    padding: 15px;
}
.sale-card-name {
    font-family: var(--font-head);
    font-size: 0.9rem;
    margin-bottom: 8px;
    height: 2.4em;
    overflow: hidden;
}
.sale-prices {
    display: flex;
    align-items: center;
    gap: 10px;
}
.old-price {
    text-decoration: line-through;
    opacity: 0.5;
    font-size: 0.8rem;
}
.new-price {
    color: var(--accent);
    font-weight: bold;
    font-size: 1.1rem;
}
@media (max-width: 992px) {
    .sale-card { flex: 0 0 calc(33.333% - 20px); }
}
@media (max-width: 768px) {
    .sale-card { flex: 0 0 calc(50% - 20px); }
}
@media (max-width: 480px) {
    .sale-card { flex: 0 0 100%; margin-right: 0; }
}

/* --- CAROUSEL ARROWS --- */
.sale-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.sale-nav-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}
.sale-nav-btn.prev { left: -22px; }
.sale-nav-btn.next { right: -22px; }
@media (max-width: 1200px) {
    .sale-nav-btn.prev { left: 10px; }
    .sale-nav-btn.next { right: 10px; }
}
