/* ==============================
   CATEGORY CARDS WITH TABS
   ============================== */
.categories-catalog {
    padding: 2rem 2rem;
    background-color: var(--white);
}

.container {
    margin: 0 auto;
}

.page-title {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-on-primary-light);
    margin-bottom: 3rem;
}

.category-card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 100, 20,0.1);
    margin-bottom: 2.5rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.category-header {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    padding: 1.5rem;
}

.category-image {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 400px;      /* ✅ prevent extra-wide images */
  max-height: 60dvh;     /* ✅ limit height to viewport */
  aspect-ratio: 4 / 3;   /* ✅ maintain consistent proportions */
  border-radius: 0.5rem;
  display: flex;
  justify-content: center;  /* ✅ Center children */
  align-items: center;  /* ✅ Center children */
}

.category-image::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  transition: background 0.4s;
  border: 1px solid var(--border-on-primary-light);
  border-radius: 0.5rem;
}

.category-image:hover::after {
  background: rgba(255, 100, 20, 0.05); /* subtle overlay on hover */
}

.category-image img {
  width: 100%;
  height: 100%;          /* ✅ now fills container */
  object-fit: contain;     /* ✅ crops if needed, keeps aspect ratio */
  border-radius: 0.5rem;
  transition: transform 0.4s ease;
}

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

.category-info h2 a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-on-secondary);
    text-decoration: none;
}



.category-info h2 a:hover {
    color: var(--bg-primary);
}

.brand-name {
    color: var(--text-on-primary-light);
    font-weight: 500;
    margin: 0.3rem 0 0.8rem 0;
}

.brand-name span{
  color: var(--text-on-secondary);
}

.category-description {
    color: var(--text-on-primary-light);
}
/* Tabs */
.category-tabs {
    border-top: 1px solid var(--border-on-primary-light);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* subtle shadow for depth */
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin; /* thinner scrollbar for modern look */
    scrollbar-color: var(--bg-primary-light) transparent;
    display: flex;              /* use flexbox */
    justify-content: center;    /* center horizontally */
    align-items: center;        /* center vertically (if needed) */
    column-gap: 1rem;                  /* optional: space between li items */
}

.tab-buttons::-webkit-scrollbar {
    height: 6px;
}

.tab-buttons::-webkit-scrollbar-thumb {
    background-color: var(--border-on-primary-light);
    border-radius: 3px;
}

.tab-buttons li {
    flex: 0 0 auto;
    cursor: pointer;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-50);
    color: var(--text-on-primary-light);
    font-weight: 500;
    border-right: 1px solid var(--border-on-primary-light);
    transition: all 0.3s ease;
    border-radius: 4px 4px 0 0; /* rounded top for better feel */
    position: relative;
}

.tab-buttons li:last-child {
    border-right: none;
}

.tab-buttons li:hover {
    background-color: var(--primary-100, #f0f0f0); /* subtle hover */
    color: var(--text-on-primary-light);
}

.tab-buttons li.active {
    background-color: var(--bg-primary);
    color: var(--white);
    box-shadow: inset 0 -3px 0 var(--white); /* active indicator */
}

.tab-content {
    display: none;
    padding: 1.5rem 2rem;
    color: var(--text-on-primary-light);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.tab-content ul {
    list-style: none;
    padding-left: 0;
}

.tab-content li {
    position: relative;           /* needed for ::before absolute positioning */
    padding: 1rem 1rem;
    padding-left: 2.5em;          /* space for the bullet */
    color: var(--text-on-secondary);
}

.tab-content li::before {
    content: "♦";
    color: var(--text-on-primary-light);
    position: absolute;           /* position relative to li */
    left: 1rem;
    top: 0.75rem;                 /* vertically align with text */
    width: 2em;
}

.tab-content li:nth-child(odd) {
    background-color: var(--gray-100);
}

.tab-content li:nth-child(even) {
    background-color: var(--white);
}

.tab-content li:hover {
    background-color: var(--primary-50);
}
/* ==============================
   MINI PRODUCT CARDS INSIDE PRODUCTS TAB
   ============================== */
.products-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(0, 140px));
     gap: 1rem;
     padding-top: 0.5rem;
     justify-content: start; /* optional: align items to left */
 }

 .product-mini-card {
     background-color: var(--white);
     border-radius: 10px;
     overflow: hidden;
     text-align: center; /* keeps text centered */
     transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
     border: 1px solid var(--border-on-primary-light);
     cursor: pointer;
     position: relative;

     display: flex;           /* enable flex layout */
     flex-direction: column;  /* stack image and text vertically */
     align-items: center;     /* center horizontally */
     justify-content: center; /* center vertically if needed */
     padding: 0.5rem;         /* optional padding */
 }

 .product-mini-card img {
     width: 100%;             /* full width of card */
     max-width: 120px;        /* optional max width */
     height: auto;            /* maintain aspect ratio */
     object-fit: cover;       /* cover area without distortion */
     margin-bottom: 0.5rem;   /* spacing between image and text */
     border-radius: 6px;      /* optional rounded image */
 }

 .product-mini-info {
     text-align: center;      /* ensures text stays centered */
     display: flex;
     flex-direction: column;
     align-items: center;
 }

.product-mini-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-mini-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 24px rgba(255,100,20,0.2);
}

.product-mini-card:hover::after {
    opacity: 1;
}



.product-mini-card:hover img {
    transform: scale(1.1);
}

.product-mini-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--bg-primary-dark);
    margin: 0;
    line-height: 1.3;
}

.product-mini-price {
    font-size: 0.85rem;
    color: var(--bg-primary);
    font-weight: 600;
    margin: 0.2rem 0 0 0;
}

/* Adjust tabs padding for mini grid */
.tab-content .products-grid {
    padding: 1rem 0;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .category-header {
        grid-template-columns: 1fr;
    }
    .category-image img {
        height: 200px;
    }
}
