:root {
    --categories-page-brand-main: #6c5ce7;
    --categories-page-brand-secondary: #a29bfe;
    --categories-page-accent: #00cec9;
    --categories-page-danger: #ff7675;
    --categories-page-success: #55efc4;
    --categories-page-info: #0984e3;
    --categories-page-warning: #ffeaa7;
    --categories-page-bg-dark: #0f172a;
    --categories-page-card-bg: #ffffff;
    --categories-page-text-main: #1e293b;
    --categories-page-text-muted: #64748b;
    --categories-page-border-color: #e2e8f0;
    --categories-page-shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --categories-page-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    --categories-page-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --categories-page-gradient-primary: linear-gradient(135deg, #6c5ce7 0%, #ff7675 100%);
    --categories-page-gradient-accent: linear-gradient(135deg, #00cec9 0%, #6c5ce7 100%);
    --categories-page-gradient-fire: linear-gradient(135deg, #ff7675 0%, #ffeaa7 100%);
    --categories-page-font-display: system-ui, -apple-system, sans-serif;
    --categories-page-glow-shadow: 0 0 20px rgba(108, 92, 231, 0.2);
}

/* SVG Icon Scale */
.categories-page .icon-svg {
    width: 1.25em;
    height: 1.25em;
    fill: currentColor;
    vertical-align: middle;
}

/* --- HEADER HERO SECTION --- */
.categories-page .category-hero {
    position: relative;
    background: var(--categories-page-bg-dark);
    color: #ffffff;
    padding: 80px 20px 120px;
    text-align: center;
    overflow: hidden;
}

.categories-page .category-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 80% 20%, rgba(108, 92, 231, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(0, 206, 201, 0.2) 0%, transparent 50%);
    z-index: 1;
}

.categories-page .bg-particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

.categories-page .particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: float-particle 8s infinite linear;
}
.categories-page .particle:nth-child(1) { width: 40px; height: 40px; left: 10%; top: 20%; animation-duration: 12s; background: rgba(108, 92, 231, 0.15); }
.categories-page .particle:nth-child(2) { width: 20px; height: 20px; right: 15%; top: 30%; animation-duration: 8s; background: rgba(0, 206, 201, 0.15); }
.categories-page .particle:nth-child(3) { width: 60px; height: 60px; left: 25%; bottom: 15%; animation-duration: 18s; }
.categories-page .particle:nth-child(4) { width: 30px; height: 30px; right: 25%; bottom: 20%; animation-duration: 10s; background: rgba(255, 118, 117, 0.15); }

.categories-page .hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.categories-page .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--categories-page-gradient-fire);
    color: var(--categories-page-bg-dark);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(255, 118, 117, 0.3);
    animation: pulse-badge 2s infinite;
}

.categories-page .hero-content h1 {
    /*font-family: var(--categories-page-font-display);*/
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.categories-page .hero-content h1 span {
    background: var(--categories-page-gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.categories-page .hero-content p {
    font-size: 1.15rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
}

/* --- MAIN CONTAINER & SECTION BASIC --- */
.categories-page .main-container {
    max-width: 1300px;
    margin: -50px auto 80px;
    padding: 0 20px;
    position: relative;
    z-index: 3;
}

.categories-page .section-block {
    margin-bottom: 60px;
}

.categories-page .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.categories-page .section-title {
    /*font-family: var(--categories-page-font-display);*/
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--categories-page-bg-dark);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- SECTION 1: TRUST STATS BOARD --- */
.categories-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.categories-page .stat-card {
    background: white;
    padding: 20px 25px;
    border-radius: 16px;
    box-shadow: var(--categories-page-shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--categories-page-border-color);
}

.categories-page .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Specific Stat Icon Colors */
.categories-page .stat-icon-verified { background: #e0e7ff; color: #4f46e5; }
.categories-page .stat-icon-daily { background: #fef3c7; color: #d97706; }
.categories-page .stat-icon-rated { background: #d1fae5; color: #059669; }

.categories-page .stat-info .stat-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--categories-page-bg-dark);
    line-height: 1.2;
}

.categories-page .stat-info p {
    font-size: 0.85rem;
    color: var(--categories-page-text-muted);
}

/* --- SECTION 2: FLASH DEALS --- */
.categories-page .flash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.categories-page .flash-card {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--categories-page-border-color);
    overflow: hidden;
    box-shadow: var(--categories-page-shadow-sm);
    transition: var(--categories-page-transition);
    position: relative;
}

.categories-page .flash-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--categories-page-shadow-lg);
}

.categories-page .flash-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--danger);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}
.categories-page .flash-badge.deal{
    background: #0984e3;
}
.categories-page .flash-img-container {
    height: 160px;
    overflow: hidden;
    position: relative;
    display: block;
}

.categories-page .flash-img-container img {
    width: 100%; height: 100%; object-fit: cover; transition: var(--categories-page-transition);
}

.categories-page .flash-img-container:hover img { transform: scale(1.05); }
.categories-page .flash-img-container .logo-to-text{
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}


.categories-page .flash-timer {
    position: absolute;
    bottom: 10px; right: 10px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 2;
}

.categories-page .flash-body {
    padding: 20px;
}

.categories-page .flash-brand {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--categories-page-brand-main);
    margin-bottom: 5px;
}

.categories-page .flash-brand a {
    color: inherit;
    text-decoration: none;
}

.categories-page .flash-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--categories-page-bg-dark);
    margin-bottom: 15px;
    height: auto;
    display: block;
}

.categories-page .flash-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--categories-page-text-muted);
    font-weight: 600;
    margin-bottom: 15px;
}

.categories-page .flash-btn {
    display: block;
    width: 100%;
    border: none;
    cursor: pointer;
    text-align: center;
    background: var(--categories-page-bg-dark);
    color: white;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--categories-page-transition);
}

.categories-page .flash-btn:hover {
    background: var(--categories-page-brand-main);
}

/* --- SECTION 3: EXCLUSIVE COUPONS LIST --- */
.categories-page .coupon-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.categories-page .coupon-container{
    border-radius: 16px;
    border: 1px solid var(--categories-page-border-color);
    transition: var(--categories-page-transition);
    overflow: hidden;
}
.categories-page .coupon-container:hover {
    box-shadow: var(--categories-page-shadow-lg);
    border-color: var(--categories-page-brand-secondary);
}
.categories-page .coupon-container p.text-muted{
    font-size: 0.85rem;
    color: var(--categories-page-text-muted);
}
.categories-page .coupon-container .offer-details-section {
    width: 100%;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}
.categories-page .coupon-container .offer-details-toggle {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    font-size: 12px;
    color: #6c757d;
    cursor: pointer;
    user-select: none;
}
.categories-page .coupon-container .offer-details-toggle:hover {
    color: #333;
}
.categories-page .coupon-container .offer-details-toggle .arrow-icon {
    transition: transform 0.3s ease;
    display: inline-block;
    vertical-align: middle;
}
.categories-page .coupon-container .offer-details-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.2s ease;
    padding: 0 15px;
}
.categories-page .coupon-container .offer-details-content .text-muted{
    font-size: 0.9rem; margin: 0; white-space: pre;
}
.categories-page .coupon-container .offer-details-section.open .offer-details-content {
    max-height: 200px;
    opacity: 1;
    padding-bottom: 15px;
}
.categories-page .coupon-container .offer-details-section.open .arrow-icon {
    transform: rotate(180deg);
}

.categories-page .coupon-row {
    background: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: relative;
}

.categories-page .coupon-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.categories-page .coupon-value-box {
    width: 80px; height: 80px;
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--categories-page-border-color);
    flex-shrink: 0;
    color: var(--categories-page-brand-main);
    text-align: center;
}

.categories-page .coupon-value-box .v-num { font-size: 1.4rem; font-weight: 800; line-height: 1; word-break: break-all; }
.categories-page .coupon-value-box .v-txt { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; margin-top: 2px; }

.categories-page .coupon-details .row-tag {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(85, 239, 196, 0.2);
    color: #00b894;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    margin-bottom: 6px;
}

.categories-page .tag-verified {
    background: rgba(9, 132, 227, 0.2) !important;
    color: #0984e3 !important;
}

.categories-page .coupon-details h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--categories-page-bg-dark);
    margin-bottom: 4px;
    cursor: pointer;
}

.categories-page .coupon-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.categories-page .get-deal-btn {
    background: var(--categories-page-brand-main);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: var(--categories-page-transition);
    border: none;
    cursor: pointer;
    min-width: 140px;
    text-align: center;
}
.categories-page .get-deal-btn.deal{
    background: #5c95e7;
}

.categories-page .get-deal-btn:hover {
    background: var(--categories-page-bg-dark);
}

/* --- SECTION 4: GRID CATEGORIES --- */
.categories-page .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.categories-page .category-card {
    background: var(--categories-page-card-bg);
    border-radius: 24px;
    border: 1px solid var(--categories-page-border-color);
    box-shadow: var(--categories-page-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--categories-page-transition);
}

.categories-page .category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--categories-page-shadow-lg);
}

.categories-page .card-image-area {
    height: 180px; position: relative; overflow: hidden;
}

.categories-page .card-image-area img {
    width: 100%; height: 100%; object-fit: cover; transition: var(--categories-page-transition);
}

.categories-page .category-card:hover .card-image-area img {
    transform: scale(1.1);
}

.categories-page .overlay-badge {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: var(--categories-page-success);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 6px 14px;
    border-radius: 30px;
    z-index: 1000;
}

.categories-page .card-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-grow: 1;
    background: #ffffff;
}

.categories-page .card-icon-title {
    display: flex; align-items: center; gap: 15px;
}

.categories-page .category-icon-box {
    width: 45px; height: 45px; border-radius: 14px;
    background: #f1f5f9; color: var(--categories-page-brand-main);
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}

.categories-page .card-info .cat-name {
    /*font-family: var(--categories-page-font-display);*/ font-size: 1.25rem; color: var(--categories-page-bg-dark); font-weight: 700;
}

.categories-page .card-info .cat-name a {
    color: inherit;
    text-decoration: none;
}

.categories-page .coupon-count {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.9rem; color: var(--categories-page-text-muted); font-weight: 500;
}

.categories-page .sub-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.categories-page .sub-tag {
    font-size: 0.7rem;
    background: #f1f5f9;
    color: var(--categories-page-text-muted);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--categories-page-transition);
}

.categories-page .sub-tag:hover {
    background: var(--categories-page-brand-secondary);
    color: #ffffff;
}

.categories-page .reveal-btn-container{
    height: 100%;
    display: flex;
    align-items: flex-end;
}
.categories-page .action-btn {
    background: var(--categories-page-gradient-primary); color: #ffffff; width: 100%;
    padding: 12px; border-radius: 50px; text-decoration: none;
    font-weight: 700; font-size: 0.9rem; letter-spacing: 0.5px;
    transition: var(--categories-page-transition); display: flex; align-items: center;
    justify-content: center; gap: 10px; margin-top: 10px;
    border: none;
    cursor: pointer;
}

.categories-page .action-btn:hover {
    box-shadow: 0 8px 15px rgba(255, 118, 117, 0.3); transform: scale(1.02);
}

/* --- SECTION 5: SAVINGS BLOG/GUIDES --- */
.categories-page .guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
}

.categories-page .guide-card {
    background: white;
    border-radius: 20px;
    border: 1px solid var(--categories-page-border-color);
    overflow: hidden;
    display: flex;
    box-shadow: var(--categories-page-shadow-sm);
    transition: var(--categories-page-transition);
}

.categories-page .guide-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--categories-page-shadow-lg);
}

.categories-page .guide-img-link {
    width:40%;
    display:contents;
}

.categories-page .guide-img {
    width: 40%; object-fit: cover; display: block;
}

.categories-page .guide-content {
    padding: 20px;
    width: 60%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.categories-page .guide-date {
    font-size: 0.75rem;
    color: var(--categories-page-text-muted);
    font-weight: 600;
}

.categories-page .guide-content h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--categories-page-bg-dark);
    margin: 5px 0 10px;
    line-height: 1.4;
}

.categories-page .guide-content h2 a {
    color: inherit;
    text-decoration: none;
}

.categories-page .guide-link {
    font-size: 0.85rem;
    color: var(--categories-page-brand-main);
    text-decoration: none;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Helper Classes for specific manual styling */
.categories-page .header-ends-soon { font-size: 0.85rem; font-weight:700; color:var(--categories-page-text-muted); }
.categories-page .icon-star { color: #f1c40f; }
.categories-page .icon-dept { color: var(--categories-page-brand-main); }
.categories-page .icon-guide { color: var(--categories-page-accent); }

/* --- KEYFRAMES & ANIMATIONS --- */
@keyframes float-particle {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

@keyframes pulse-badge {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.categories-page .fire-icon { color: #ff7675; animation: flicker 1.5s infinite alternate; }
@keyframes flicker {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 992px) {
    .categories-page .coupon-row { flex-direction: column; align-items: flex-start; }
    .categories-page .coupon-right { width: 100%; justify-content: flex-end; margin-top: 10px; }
    .categories-page .get-deal-btn { width: 100%; }
}

@media (max-width: 768px) {
    .categories-page .hero-content h1 { font-size: 2.3rem; }
    .categories-page .category-hero { padding: 60px 20px 100px; }
    .categories-page .guide-card { flex-direction: column; }
    .categories-page .guide-img { width: 100%; height: 150px; }
    .categories-page .guide-content { width: 100%; }
}