/**
 * Ramy Category Slider Styles
 * Theme-first approach - inherits all colors and typography from active theme
 *
 * @package Ramy_Cat_Slider
 */

/* ==========================================================================
   CSS Custom Properties - Theme Integration
   ========================================================================== */

.ramy-cat-slider {
    /* Primary accent color - uses theme's primary color */
    --ramy-accent: var(--wp--preset--color--primary, var(--theme-primary, currentColor));

    /* Contrast color for text on accent backgrounds */
    --ramy-accent-contrast: var(--wp--preset--color--base, var(--theme-contrast, #ffffff));

    position: initial;
    width: 100%;
    padding: 30px 0;
}

/* ==========================================================================
   Slider Container
   ========================================================================== */

.ramy-slider-container {
    position: initial;
    overflow: hidden;
    width: 100%;
}

/* Swiper core structure */
.ramy-slider-container .swiper-wrapper {
    display: flex;
    transition-property: transform;
    box-sizing: content-box;
}

.ramy-slider-container .swiper-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    position: relative;
    transition-property: transform;
}

/* ==========================================================================
   Category Card - Inherits all styles from theme
   ========================================================================== */

.ramy-cat-card {
    /* Inherit background, border, shadows from theme/Elementor */
    background: inherit;
    border: inherit;
    border-radius: inherit;
    box-shadow: inherit;

    /* Only control the hover animation */
    transition: transform 0.3s ease;
}

.ramy-cat-card:hover {
    transform: translateY(-5px);
}

.ramy-cat-card-inner {
    display: block;
    text-decoration: none;
    color: inherit;
    /* Inherit text color from theme */
    padding: 20px;
    height: 100%;
}

/* ==========================================================================
   Category Image - Minimal styling
   ========================================================================== */

.ramy-cat-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    background: transparent;
    /* Let theme handle background */
    margin-bottom: 15px;
}

.ramy-cat-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ramy-cat-card:hover .ramy-cat-image img {
    transform: scale(1.05);
}

/* ==========================================================================
   Category Content - Fully inherits from theme
   ========================================================================== */

.ramy-cat-content {
    text-align: center;
}

.ramy-cat-title {
    /* Inherit everything from theme */
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    margin: 0 0 8px 0;
}

.ramy-cat-card:hover .ramy-cat-title {
    color: var(--ramy-accent);
    /* Use theme's accent on hover */
}

.ramy-cat-count {
    color: inherit;
    /* Inherit text color from theme */
    font-size: 0.85em;
    /* Slightly smaller than inherited size */
    opacity: 0.7;
    /* Subtle opacity for hierarchy */
    display: block;
    /* Allow hiding via control */
}

/* Hide count when disabled */
.ramy-cat-slider.hide-count .ramy-cat-count {
    display: none;
}


/* ==========================================================================
   Navigation Arrows - Uses theme colors
   ========================================================================== */

.ramy-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: none;
    /* Theme's primary color */
    color: var(--e-global-color-primary);;
    /* Theme's contrast color */
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: solid 2px currentColor;
    
    outline: none;
}

.ramy-slider-nav:hover {
    opacity: 0.85;
    /* Subtle hover effect */
    transform: translateY(-50%) scale(1.05);
}

.ramy-slider-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.ramy-slider-prev {
    left: -25px;
}

.ramy-slider-next {
    right: -25px;
}

.ramy-slider-nav i {
    font-size: 20px;
}

/* Disabled state */
.ramy-slider-nav.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ==========================================================================
   Pagination - Uses theme colors
   ========================================================================== */

.ramy-cat-slider .swiper-pagination {
    position: relative;
    margin-top: 20px;
}

.ramy-cat-slider .swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: currentColor;
    /* Inherits from theme */
    opacity: 0.3;
    transition: all 0.3s ease;
}

.ramy-cat-slider .swiper-pagination-bullet-active {
    background: var(--ramy-accent);
    /* Theme's accent color */
    opacity: 1;
    width: 24px;
    border-radius: 5px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1024px) {
    .ramy-slider-prev {
        left: 10px;
    }

    .ramy-slider-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .ramy-cat-slider {
        padding: 20px 0;
    }

    .ramy-cat-card-inner {
        padding: 16px;
    }

    .ramy-cat-image {
        height: 160px;
        margin-bottom: 12px;
    }

    /* Hide arrows on mobile, rely on swipe */
    .ramy-slider-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .ramy-cat-slider {
        padding: 15px 0;
    }

    .ramy-cat-card-inner {
        padding: 12px;
    }

    .ramy-cat-image {
        height: 140px;
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.ramy-cat-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

.ramy-slider-container .swiper-slide:nth-child(1) .ramy-cat-card {
    animation-delay: 0.05s;
}

.ramy-slider-container .swiper-slide:nth-child(2) .ramy-cat-card {
    animation-delay: 0.1s;
}

.ramy-slider-container .swiper-slide:nth-child(3) .ramy-cat-card {
    animation-delay: 0.15s;
}

.ramy-slider-container .swiper-slide:nth-child(4) .ramy-cat-card {
    animation-delay: 0.2s;
}

.ramy-slider-container .swiper-slide:nth-child(5) .ramy-cat-card {
    animation-delay: 0.25s;
}

.ramy-slider-container .swiper-slide:nth-child(6) .ramy-cat-card {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.elementor-screen-only,
.ramy-slider-nav .elementor-screen-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus states for keyboard navigation */
.ramy-slider-nav:focus {
    outline: 2px solid var(--ramy-accent);
    outline-offset: 2px;
}

.ramy-cat-card-inner:focus {
    outline: 2px solid var(--ramy-accent);
    outline-offset: -2px;
    border-radius: 12px;
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

.rtl .ramy-slider-prev {
    left: auto;
    right: -25px;
}

.rtl .ramy-slider-next {
    right: auto;
    left: -25px;
}

@media (max-width: 1024px) {
    .rtl .ramy-slider-prev {
        right: 10px;
    }

    .rtl .ramy-slider-next {
        left: 10px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {

    .ramy-slider-nav,
    .swiper-pagination {
        display: none;
    }

    .ramy-cat-card {
        box-shadow: none;
        border: 1px solid currentColor;
        /* Use theme text color */
        opacity: 0.5;
    }
}