/* Modern Premium Styles for Category & All Products Pages */

body {
    font-family: 'Inter', sans-serif;
}

/* ---- Page Wrapper ---- */
.cn-page, .ap-page {
    min-height: 100vh;
    background: #ffffff; /* Softer, slightly blue background from image */
    padding: 0 0 100px;
}

/* ---- Hero Banner (Matching event_new Design) ---- */
.cn-hero-banner {
    background: linear-gradient(135deg, #0f4c4e 0%, #186b6d 60%, #1a8080 100%);
    padding: 70px 0 65px;
    position: relative;
    overflow: hidden;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cn-hero-banner .cn-container {
    position: relative;
    z-index: 1;
}
.cn-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    color: #e6f7f5;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.cn-hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #34d399;
    display: inline-block;
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
}
.cn-hero-title {
    font-size: 44px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.025em;
    margin: 0 0 16px;
    line-height: 1.15;
}
.cn-hero-desc {
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.86);
    max-width: 920px;
    margin: 0;
    font-weight: 400;
}

/* ---- Legacy Hero Banner ---- */
.cn-hero, .ap-hero {
    background: #f8fafc;
    color: #0f172a;
    padding: 60px 0; 
    text-align: center;
    position: relative;
    border-bottom: 1px solid #e2e8f0;
    overflow: hidden;
}
.cn-hero h1, .ap-hero h1 {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    margin-bottom: 20px;
    color: #0f172a;
    line-height: 1.1;
}
.cn-hero p, .ap-hero p {
    font-size: 16px;
    color: #475569;
    margin: 0 auto;
    line-height: 1.7;
    position: relative;
    font-weight: 400;
}

/* ---- Container ---- */
.cn-container, .ap-container {
    max-width: 1400px;
    
    margin: 0 auto;
    padding: 0 32px;
}

/* ---- Layout: Sidebar + Grid (Category Page) ---- */
.cn-layout {
    display: flex;
    gap: 40px;
    margin-top: 40px;
    align-items: flex-start;
}

/* ---- Sidebar ---- */
.cn-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    padding: 24px 0;
    position: sticky;
    top: 100px;
    border: 1px solid #f1f5f9;
}
.cn-sidebar-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    padding: 0 24px 12px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 8px;
}
.cn-sidebar a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}
.cn-sidebar a:hover {
    background: #f8fafc;
    color: #186B6D;
    padding-left: 28px;
}
.cn-sidebar a.active {
    background: #f0fdfa;
    color: #186B6D;
    font-weight: 700;
    border-left-color: #186B6D;
}
.cn-sidebar a svg {
    opacity: 0.5;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.cn-sidebar a:hover svg, .cn-sidebar a.active svg {
    opacity: 1;
    color: #186B6D;
}

/* ---- Main Content Area ---- */
.cn-main { flex: 1; min-width: 0; }

.cn-toolbar, .ap-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.cn-count, .ap-count {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}
.cn-count strong, .ap-count strong { 
    color: #0f172a; 
    font-weight: 700;
}

/* ---- Search + Filter Bar (All Products Page) ---- */
.ap-filter-bar {
    display: flex;
    gap: 16px;
    margin: 40px 0 24px;
    flex-wrap: wrap;
    align-items: center;
}
.ap-search {
    flex: 1;
    min-width: 240px;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 0 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}
.ap-search:focus-within { 
    border-color: #186B6D; 
}
.ap-search svg { color: #94a3b8; flex-shrink: 0; }
.ap-search input {
    border: none;
    outline: none;
    font-size: 14px;
    padding: 14px 12px;
    width: 100%;
    background: transparent;
    color: #0f172a;
}
.ap-search input::placeholder { color: #94a3b8; }

.ap-cat-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.ap-cat-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.ap-cat-btn:hover { 
    border-color: #cbd5e1; 
    color: #0f172a; 
    background: #f8fafc; 
}
.ap-cat-btn.active { 
    background: #186B6D; 
    color: #ffffff; 
    border-color: #186B6D; 
}

/* ---- Product Grid ---- */
.cn-grid, .ap-grid {
    display: grid;
    /* User wants 4 columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.cn-card, .ap-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease;
    border: 1px solid #f1f5f9;
}
.cn-card:hover, .ap-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.09);
    border-color: #e2e8f0;
}
.cn-card-img-wrap, .ap-card-img-wrap { 
    overflow: hidden; 
    position: relative; 
    height: 190px;
    background: #f0f3f6; /* Very light gray background for images */
}
.cn-card-img, .ap-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover is usually best, or contain if images have white bgs */
    transition: transform 0.5s ease;
}
.cn-card:hover .cn-card-img, .ap-card:hover .ap-card-img { 
    transform: scale(1.05); 
}

.cn-card-tag, .ap-card-tag, .ap-card-cat-tag {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: #2e3a47; /* Dark navy */
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cn-card-body, .ap-card-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cn-card-title, .ap-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    line-height: 1.3;
}
.cn-card-desc, .ap-card-desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cn-card-footer, .ap-card-footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Left aligned like the image */
}
.cn-card-link, .ap-card-link {
    font-size: 13px;
    font-weight: 700;
    color: #186B6D;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s;
}
.cn-card:hover .cn-card-link, .ap-card:hover .ap-card-link { 
    gap: 10px; 
}

/* ---- Empty State ---- */
.cn-empty, .ap-no-results {
    text-align: center;
    padding: 80px 20px;
    color: #94a3b8;
    grid-column: 1/-1;
    background: #ffffff;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
}
.cn-empty svg, .ap-no-results svg { 
    margin-bottom: 16px; 
    opacity: 0.4; 
    width: 48px;
    height: 48px;
}
.cn-empty p, .ap-no-results p { 
    font-size: 16px; 
    color: #475569;
}
.ap-no-results { display: none; }
.ap-no-results.visible { display: block; }

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .cn-grid, .ap-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
    .cn-layout { gap: 24px; flex-direction: column; }
    .cn-sidebar { width: 100%; position: static; padding: 20px; display: flex; flex-direction: column; }
    .cn-sidebar-title { margin-bottom: 12px; padding: 0 0 10px; border-bottom: none; }
    
    .cn-sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
    .cn-sidebar-title { width: 100%; }
    .cn-sidebar a { 
        padding: 8px 14px; 
        border: 1px solid #e2e8f0; 
        border-radius: 20px; 
        border-left: 1px solid #e2e8f0;
    }
    .cn-sidebar a:hover { padding-left: 14px; border-color: #cbd5e1; background: #f8fafc; }
    .cn-sidebar a.active { border-color: #186B6D; background: #186B6D; color: #ffffff; }
    .cn-sidebar a.active svg { color: #ffffff; }
}

@media (max-width: 768px) {
    .cn-grid, .ap-grid { grid-template-columns: repeat(2, 1fr); }
    .cn-hero, .ap-hero { padding: 60px 0; }
    .cn-hero h1, .ap-hero h1 { font-size: 32px; }
    .cn-hero p, .ap-hero p {
     font-size: 15px; }
    .cn-container, .ap-container {
    max-width: 1400px; padding: 0 20px; }
    
    .ap-filter-bar { flex-direction: column; align-items: stretch; }
    .ap-search { width: 100%; }
}

@media (max-width: 480px) {
    .cn-grid, .ap-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   RESPONSIVE OVERRIDES: Category (Tablet & Mobile Only)
   ========================================================= */
@media (max-width: 1024px) {
  .cn-hero-title {
    font-size: 34px !important;
  }
  .cn-hero-desc {
    font-size: 15px !important;
  }
  .cn-hero-banner {
    padding: 48px 0 44px !important;
  }
  .cn-container {
    padding: 0 20px !important;
  }
}
@media (max-width: 767px) {
  .cn-hero-title {
    font-size: 28px !important;
    margin-bottom: 12px !important;
  }
  .cn-hero-banner {
    padding: 40px 0 36px !important;
  }
  .cn-hero-desc {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
  .cn-hero-badge {
    font-size: 12px !important;
    padding: 5px 12px !important;
    margin-bottom: 14px !important;
  }
  .cn-sidebar {
    padding: 14px !important;
    gap: 6px !important;
  }
  .cn-sidebar a {
    font-size: 13px !important;
    padding: 7px 12px !important;
  }
  .cn-card-img-wrap {
    height: 170px !important;
  }
  .cn-card-body {
    padding: 16px 18px 20px !important;
  }
  .cn-card-title {
    font-size: 15px !important;
  }
}
@media (max-width: 480px) {
  .cn-hero-title {
    font-size: 24px !important;
  }
  .cn-hero-banner {
    padding: 32px 0 28px !important;
  }
  .cn-container {
    padding: 0 16px !important;
  }
  .cn-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .cn-sidebar a {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
}

/* ---- Category hero: category photo from admin as full background (like About Us) ---- */
.cn-hero-banner.has-photo { background-color: #0f4c4e; }

/* Product cards: show the whole machine (no cropping) on a clean white panel */
.cn-grid .cn-card-img-wrap, .cn-card .cn-card-img-wrap, .ap-card .ap-card-img-wrap {
    height: 240px;
    padding: 18px;
    background: #ffffff;
    border-bottom: 1px solid #eef1f3;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cn-card .cn-card-img, .ap-card .ap-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.cn-card:hover .cn-card-img, .ap-card:hover .ap-card-img { transform: scale(1.04); }
@media (max-width: 767px) {
    .cn-grid .cn-card-img-wrap, .cn-card .cn-card-img-wrap, .ap-card .ap-card-img-wrap { height: 200px !important; padding: 14px; }
}
