/* ============================================================
   FRONT PAGE — extracted from front-page.php inline <style>.
   All hardcoded values replaced with design tokens
   (assets/css/tokens/*). Designers can retheme the entire
   front page by editing tokens only — no PHP changes.
   ============================================================ */

/* ---------- Featured Carousel Section ---------- */
.featured-carousel-section {
    padding: var(--spacing-2xl) 0;
    background: var(--color-bg-card);
}

.featured-carousel {
    position: relative;
    padding-bottom: var(--spacing-2xl);
}

.featured-carousel .swiper-slide {
    width: calc((100% - 36px) / 4);
    min-width: 240px;
    margin-left: 0 !important;
    margin-right: 8px !important;
    height: auto !important;
}

.featured-carousel .swiper-wrapper {
    align-items: stretch;
}

.carousel-product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.carousel-product-card .product-image-container {
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.carousel-product-card .product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-product-card .product-title-section {
    flex: 1;
}

.carousel-product-card .product-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.6em;
    line-height: var(--line-height-tight);
}

.carousel-product-card .product-price-section {
    margin-top: auto;
}

.featured-carousel .swiper-slide {
    height: auto !important;
}

.sold-out-badge {
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--color-radius-pill);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

.featured-carousel .swiper-button-next,
.featured-carousel .swiper-button-prev {
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    width: 40px;
    height: 40px;
    border-radius: var(--color-radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
}

.featured-carousel .swiper-button-next:hover,
.featured-carousel .swiper-button-prev:hover {
    background: var(--color-brand-primary-dark);
}

.featured-carousel .swiper-button-next::after,
.featured-carousel .swiper-button-prev::after {
    font-size: 18px;
    font-weight: var(--font-weight-bold);
}

.featured-carousel .swiper-pagination {
    bottom: 10px;
}

.featured-carousel .swiper-pagination-bullet {
    background: var(--color-text-light);
    width: 10px;
    height: 10px;
}

.featured-carousel .swiper-pagination-bullet-active {
    background: var(--color-brand-primary);
}

@media (max-width: 768px) {
    .featured-carousel .swiper-slide {
        width: 240px;
    }

    .featured-carousel .swiper-button-next,
    .featured-carousel .swiper-button-prev {
        display: none;
    }
}

/* ---------- Hero Section ---------- */
.hero-section {
    background: linear-gradient(135deg, var(--color-brand-primary) 0%, var(--color-brand-charcoal) 100%);
    color: var(--color-text-inverse);
    padding: var(--spacing-4xl) 0;
    text-align: center;
}

.hero-content h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--spacing-md);
    color: var(--color-text-inverse);
}

.hero-content p {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.btn-primary {
    display: inline-block;
    background: var(--color-bg-card);
    color: var(--color-brand-primary);
    padding: var(--spacing-md) var(--spacing-2xl);
    border-radius: var(--color-radius-pill);
    text-decoration: none;
    font-weight: var(--font-weight-bold);
    transition: transform var(--animation-duration-normal) var(--animation-easing-ease);
}

.btn-primary:hover {
    transform: scale(1.05);
}

/* ---------- Main Deal Section ---------- */
.main-deal-section {
    padding: var(--spacing-2xl) 0;
    background: var(--color-bg-secondary);
}

.main-deal-header-strip {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-base) var(--spacing-lg);
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    border-radius: var(--color-radius-sm);
    margin-bottom: var(--spacing-lg);
}

.header-strip-title {
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
}

.main-deal-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
}

@media (max-width: 768px) {
    .main-deal-content-grid {
        grid-template-columns: 1fr;
    }
}

.main-deal-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-md);
    color: var(--color-text-dark);
}

.main-deal-excerpt {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: var(--line-height-loose);
}

.main-deal-purchase-zone {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.price-box {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.old-price {
    text-decoration: line-through;
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
}

.price-final {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-brand-primary);
}

.sold-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sold-count {
    background: var(--color-brand-charcoal);
    color: var(--color-text-inverse);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--color-radius-pill);
    font-size: 0.85rem;
}

.btn-ribbon {
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    padding: var(--spacing-base) var(--spacing-3xl);
    border: none;
    border-radius: var(--color-radius-pill);
    font-size: var(--font-size-lg);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-ribbon:hover {
    background: var(--color-brand-primary-dark);
}

.main-deal-gallery-column {
    text-align: center;
}

.main-deal-image {
    max-width: 100%;
    border-radius: var(--color-radius-pill);
    box-shadow: 0 10px 30px var(--color-shadow);
}

/* ---------- Products Grid ---------- */
.products-grid-section {
    padding: var(--spacing-2xl) 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 2px solid var(--color-border-light);
}

.section-header h2 {
    font-size: var(--font-size-2xl);
    color: var(--color-text-dark);
}

.view-all-link {
    color: var(--color-brand-primary);
    text-decoration: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

.product-card {
    background: var(--color-bg-card);
    border-radius: var(--color-radius-md);
    overflow: hidden;
    box-shadow: 0 2px 10px var(--color-shadow-sm);
    transition: transform var(--animation-duration-normal) var(--animation-easing-ease),
                box-shadow var(--animation-duration-normal) var(--animation-easing-ease);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--color-shadow-md);
}

.product-badges {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    z-index: 2;
}

.discount-badge-top {
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--color-radius-pill);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

.product-image-container {
    position: relative;
    display: block;
}

.product-image-container img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.product-features {
    padding: var(--spacing-sm) var(--spacing-base);
}

.feature-badges-row {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.feature-badge {
    font-size: var(--font-size-xs);
    padding: 3px var(--spacing-sm);
    border-radius: 10px;
}

.feature-badge.sold {
    background: var(--color-brand-charcoal);
    color: var(--color-text-inverse);
}

.ramadan-badge-sm {
    background: var(--color-brand-sand);
    color: var(--color-text-inverse);
    padding: 3px var(--spacing-sm);
    border-radius: 10px;
    font-size: var(--font-size-xs);
}

.product-title-section {
    padding: 0 var(--spacing-base);
}

.product-name {
    font-size: var(--font-size-sm-base);
    margin: 0;
    line-height: var(--line-height-normal);
}

.product-name a {
    color: var(--color-text-dark);
    text-decoration: none;
}

.product-price-section {
    padding: var(--spacing-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-wrapper {
    display: flex;
    flex-direction: column;
}

.old-price {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.special-price {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-brand-primary);
}

.buy-button {
    background: var(--color-brand-primary);
    color: var(--color-text-inverse);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--color-radius-pill);
    text-decoration: none;
    font-size: var(--font-size-base);
}

.buy-button.out-of-stock {
    background: var(--color-text-muted);
}

.ramadan-badge {
    background: var(--color-brand-sand);
    color: var(--color-text-inverse);
    padding: var(--spacing-xs) var(--spacing-base);
    border-radius: var(--color-radius-pill);
    font-size: var(--font-size-base);
}

/* Hide Main Deal section on the home page.
   The PHP/HTML is still served (so future re-enable is one-line),
   but the section is collapsed with display:none + a tiny transition
   so we don't see the parallax orbs / particles / layout space. */
.main-deal-section {
    display: none !important;
}

/* ===== Featured carousel — AJAX same-page navigation ===== */
/* The active slide is wrapped in a viewport so the slide-in animation
   stays inside the carousel box. */
.featured-carousel {
    overflow: hidden;
    position: relative;
}
.featured-carousel .swiper-wrapper {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
/* The slide-in animation. We add .sheel-slide-in-left or
   .sheel-slide-in-right to the active slide briefly, then remove
   it once the AJAX fetch resolves. */
.sheel-card-skeleton {
    pointer-events: none;
    user-select: none;
}
.sheel-card-skeleton .product-card {
    background: var(--color-surface, #f3f3f6);
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,.6) 50%,
        rgba(255,255,255,0) 100%
    ), var(--color-surface, #f3f3f6);
    background-size: 200% 100%;
    animation: sheel-skeleton-shine 1.2s ease-in-out infinite;
    min-height: 360px;
    border-radius: var(--color-radius-lg, 12px);
}
.sheel-card-skeleton .product-card * {
    visibility: hidden !important;
}
@keyframes sheel-skeleton-shine {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.sheel-slide-in-left  { animation: sheel-slide-in-left  .35s ease both; }
.sheel-slide-in-right { animation: sheel-slide-in-right .35s ease both; }
@keyframes sheel-slide-in-left {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0);    }
}
@keyframes sheel-slide-in-right {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0);     }
}
.sheel-ajax-loading .featured-carousel {
    cursor: progress;
}
.sheel-ajax-loading .featured-carousel .swiper-button-prev,
.sheel-ajax-loading .featured-carousel .swiper-button-next {
    opacity: 0.4;
    pointer-events: none;
}

/* Featured carousel: hide pagination dots, always show arrows */
.featured-carousel .swiper-pagination {
    display: none !important;
}

.featured-carousel .swiper-button-prev,
.featured-carousel .swiper-button-next {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

@media (max-width: 480px) {
    .featured-carousel .swiper-button-prev,
    .featured-carousel .swiper-button-next {
        width: 36px;
        height: 36px;
    }
    .featured-carousel .swiper-button-prev {
        left: 4px;
    }
    .featured-carousel .swiper-button-next {
        right: 4px;
    }
    .featured-carousel .swiper-button-prev::after,
    .featured-carousel .swiper-button-next::after {
        font-size: 14px;
    }
}

/* Featured carousel: smooth transition */
.featured-carousel .swiper-wrapper {
    transition-timing-function: ease-in-out !important;
    transition-duration: 500ms !important;
    will-change: transform;
}
