/* ===== CUSTOM.CSS - OPTIMIZED KOOPAWNS STYLESHEET ===== */

/* ===== CSS RESET & BASE STYLES ===== */
* {
    box-sizing: border-box;
}

/* ===== LAYOUT & GRID STYLES ===== */
.grid-cols-\[30\%_70\%\] {
  grid-template-columns: 30% 70%;
}

/* ===== COMPONENT STYLES ===== */

/* === OFF-CANVAS MENU COMPONENT === */
#offcanvas-toggle { display: none; }

.offcanvas-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 98;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.offcanvas-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 99;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.offcanvas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.offcanvas-body {
    padding: 1rem;
}

.offcanvas-body a {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.offcanvas-body a:hover {
    background: #eff6ff;
    color: #2563eb;
}

#offcanvas-toggle:checked ~ .offcanvas-overlay {
    opacity: 1;
    visibility: visible;
}

#offcanvas-toggle:checked ~ .offcanvas-sidebar {
    transform: translateX(0);
}

#offcanvas-toggle:checked ~ .container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.close-btn {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
}

.close-btn:hover {
    background: #f3f4f6;
}

/* === COUPON CODE COMPONENT === */
.coupon-toggle { display: none; }
.coupon-code-container { display: none; }
.coupon-toggle:checked ~ .coupon-code-container { display: block; }
.coupon-toggle:checked + .coupon-reveal-btn .coupon-reveal-text {
  background-color: #DCFCE7;
  color: #166534;
}
.coupon-toggle:checked + .coupon-reveal-btn .coupon-reveal-text::before {
  content: "CODE REVEALED";
}
.coupon-toggle:checked + .coupon-reveal-btn .coupon-chevron {
  transform: rotate(180deg);
  color: #2563EB;
}
.coupon-reveal-btn { cursor: pointer; }
.coupon-reveal-text::before {
  content: "CLICK TO REVEAL CODE";
}

/* === CATEGORY COMPONENTS === */
.category-card {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}
.category-card:hover {
    border-left-color: #4f46e5;
    background-color: #f8fafc;
}
.offer-count {
    background-color: #4f46e5;
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}
.subcategory-item {
    border-left: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}
.subcategory-item:hover {
    background-color: #f1f5f9;
}

/* === OFFER CARD COMPONENTS === */
.rh_offer_list {
    transition: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ad-container {
    min-height: 90px;
}

/* === CAROUSEL COMPONENT === */
.carousel-container {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding-bottom: 1rem;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
}

.carousel-slide {
    flex: 0 0 calc(25% - 1rem);
    min-width: 0;
    margin-right: 1rem;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.nav-dots {
    display: flex;
    gap: 0.5rem;
}

.dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: #d1d5db;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dot.active {
    background-color: #3b82f6;
}

.carousel-prev,
.carousel-next {
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-prev:hover,
.carousel-next:hover {
    background-color: #2563eb;
}

/* === BACK TO TOP COMPONENT === */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #2563eb;
    color: white;
    padding: 0.75rem;
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    z-index: 101;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
}

#backToTop:hover {
    background-color: #1d4ed8;
    transform: translateY(-2px);
}

#backToTop:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* ===== UTILITY CLASSES ===== */
.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }
.invisible { visibility: hidden; }
.visible { visibility: visible; }

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin-top: -0.5rem;
    margin-left: -0.5rem;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* === ACCESSIBILITY UTILITIES === */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: white;
    padding: 8px;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

.offer-section:focus {
    outline: none;
}

.carousel-slide a:focus,
.carousel-prev:focus,
.carousel-next:focus,
.dot:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 480px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    #backToTop {
        bottom: 1.5rem;
        right: 1.5rem;
        padding: 0.875rem;
    }
    
    #backToTop svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

@media (max-width: 767px) {
    .grid-cols-\[30\%_70\%\] {
        grid-template-columns: 100%;
    }
    
    .carousel-slide {
        flex: 0 0 calc(100% - 1rem);
    }
    
    .md-hidden {
        display: block;
    }
    
    .offcanvas-overlay,
    .offcanvas-sidebar {
        display: block;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .carousel-slide {
        flex: 0 0 calc(50% - 1rem);
    }
    
    .offcanvas-overlay,
    .offcanvas-sidebar {
        display: none !important;
    }
    
    .md-hidden {
        display: none;
    }
}

@media (min-width: 1024px) {
    .carousel-slide {
        flex: 0 0 calc(25% - 1rem);
    }
    
    .grid-cols-\[30\%_70\%\] {
        grid-template-columns: 30% 70%;
    }
}

@media print {
    .offcanvas-overlay,
    .offcanvas-sidebar,
    #backToTop {
        display: none !important;
    }
}