@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@1,400&family=Lato:wght@300;400;700&display=swap");

@font-face {
    font-family: "Taiganja";
    src: url("https://www.idine.ca/wp-content/uploads/2025/08/Taiganja-Type.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.idine-promotions-section {
    font-family: "Lato", sans-serif;
    background-color: transparent;
    color: inherit;
    padding: 0;
    position: relative;
}

.idine-promotions-section .promotions-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.promotions-header {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.idine-promotions-section .promotions-main-title {
    font-family: "Taiganja", serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #faba13;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.idine-promotions-slider {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    min-height: 360px;
    transition: transform 0.4s ease;
}

/* Prevent text/image selection and dragging inside the slider */
.idine-promotions-slider,
.idine-promotions-slider * {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.idine-promotions-slider img {
    -webkit-user-drag: none;
    user-drag: none;
}

.idine-promotions-slider:focus-visible {
    outline: 2px solid rgba(250, 186, 19, 0.7);
    outline-offset: 6px;
}

.idine-promotions-slider.is-dragging {
    cursor: grabbing;
}

.idine-promotions-slider.is-dragging .idine-promotions-track {
    transition: none !important;
}

.idine-promotions-viewport {
    overflow: hidden;
    width: 100%;
}

.idine-promotions-track {
    display: flex !important;
    gap: 2rem !important;
    transition: transform 0.65s cubic-bezier(0.33, 1, 0.68, 1) !important;
    will-change: transform !important;
    padding: 1rem 0.5rem !important;
}

@keyframes idineCardIn {
    0% {
        opacity: 0;
        transform: translate3d(0, 30px, 0) scale(0.96);
    }
    60% {
        opacity: 1;
        transform: translate3d(0, -6px, 0) scale(1.01);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

.promotion-card {
    background: linear-gradient(180deg, rgba(17, 34, 34, 0.92) 0%, rgba(10, 20, 20, 0.92) 100%);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    flex: 0 0 100%;
    max-width: 100%;
    width: 100%;
    min-width: 320px;
    transition: box-shadow 0.35s ease, transform 0.35s ease, opacity 0.35s ease;
    opacity: 1;
    transform: translate3d(0, 0, 0);
    height: fit-content;  /* Allow card to size to content */
}

.idine-promotions-slider[data-ready="true"] .promotion-card {
    opacity: 0;
    transform: translate3d(0, 25px, 0) scale(0.96);
}

.idine-promotions-slider[data-ready="true"] .promotion-card.is-active {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    animation: idineCardIn 0.65s cubic-bezier(0.33, 1, 0.68, 1) both;
    /* Remove yellow glow on active cards; keep a subtle dark drop shadow */
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.25);
}

.promotion-image-wrapper {
    width: 100%;
    padding-top: 92.6%;  /* 1000/1080 * 100 = 92.6% for 1080x1000 aspect ratio */
    position: relative;
    overflow: hidden;
}

.promotion-image-wrapper img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.1);
    transition: transform 0.5s ease;
}

.promotion-card.is-active .promotion-image-wrapper img {
    transform: scale(1.05);
}

.promotion-content {
    padding: 1.5rem 1.75rem 2rem !important;
    display: flex;
    flex-direction: column;
    gap: 0.5rem !important;
    text-align: left;
}

/* Read more/less button for long descriptions */
.promotion-readmore {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    margin-top: 0.25rem;
    color: #faba13;
    font-weight: 700;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent; /* remove tap highlight */
    background-clip: padding-box;
}

.promotion-readmore:hover,
.promotion-readmore:focus-visible {
    text-decoration: underline;
    outline: none;
    background-color: transparent !important; /* prevent hover fill */
    color: #faba13; /* keep color consistent; no blue */
}

/* Prevent translucent fill and inner focus border */
.promotion-readmore:focus,
.promotion-readmore:active {
    outline: none;
    box-shadow: none;
    background-color: transparent !important;
}

.promotion-readmore::-moz-focus-inner {
    border: 0;
}

/* Guard against theme pseudo-element overlays */
.promotion-readmore::before,
.promotion-readmore::after {
    content: none !important;
}

.promotion-title {
    font-family: "Cormorant Garamond", serif !important;
    font-size: 1.9rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
}

.promotion-price {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #faba13 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}

.promotion-description {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: #d9d9d9 !important;
    margin-top: 0.25rem !important;
}

.promotion-description p {
    margin: 0 0 1rem;
}

.promotion-description p:last-child {
    margin-bottom: 0;
}

.idine-slider-control {
    border: 2px solid rgba(250, 186, 19, 0.65);
    border-radius: 50%;
    width: clamp(44px, 5vw, 52px);
    height: clamp(44px, 5vw, 52px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 20, 20, 0.35);
    color: #faba13;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent; /* remove tap highlight on mobile */
    background-clip: padding-box;
}

.idine-slider-control:hover,
.idine-slider-control:focus-visible {
    background-color: rgba(250, 186, 19, 0.3);
    color: #ffd700;
    transform: scale(1.08);
}

/* Prevent translucent fill on mouse click focus */
.idine-slider-control:focus {
    outline: none;
    box-shadow: none;
    background-color: rgba(8, 20, 20, 0.35) !important;
}

.idine-slider-control:focus:not(:focus-visible) {
    outline: none;
    background-color: rgba(8, 20, 20, 0.35) !important;
}

.idine-slider-control::-moz-focus-inner {
    border: 0;
}

/* Re-apply visible focus style explicitly (overrides reset above) */
.idine-slider-control:focus-visible {
    background-color: rgba(250, 186, 19, 0.3) !important;
    color: #ffd700 !important;
}

/* Guard against theme pseudo-element overlays on click */
.idine-slider-control::before,
.idine-slider-control::after {
    content: none !important;
}

.idine-slider-control[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.idine-slider-control span {
    font-size: 1.5rem;
    line-height: 1;
}

.idine-promotions-pagination {
    display: flex;
    justify-content: center;
    margin-top: clamp(1.75rem, 4vw, 2.5rem);
    gap: 0.75rem;
}

.idine-promotions-pagination button {
    background-color: rgba(250, 186, 19, 0.25);
    border: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    padding: 0;
}

.idine-promotions-pagination button.is-active {
    background-color: #faba13;
    transform: scale(1.3);
}

.idine-promotions-pagination button:focus-visible {
    outline: 2px solid #faba13;
    outline-offset: 3px;
}

@media (min-width: 768px) {
    .promotion-card {
        flex: 0 0 calc((100% - clamp(1.5rem, 3vw, 2.5rem)) / 2);
        max-width: min(600px, calc((100% - clamp(1.5rem, 3vw, 2.5rem)) / 2));
    }
}

@media (min-width: 1200px) {
    .promotion-card {
        flex: 0 0 calc((100% - 2 * clamp(1.5rem, 3vw, 2.5rem)) / 3);
        max-width: min(450px, calc((100% - 2 * clamp(1.5rem, 3vw, 2.5rem)) / 3));
    }
}

@media (max-width: 768px) {
    .idine-promotions-slider {
        gap: 0.75rem;
    }

    .idine-slider-control {
        display: none !important; /* hide arrows on mobile */
    }

    .idine-slider-control.prev {
        left: 0.5rem;
    }

    .idine-slider-control.next {
        right: 0.5rem;
    }
}

@media (max-width: 600px) {
    .promotions-header {
        margin-bottom: 1.5rem;
    }

    .idine-promotions-slider {
        min-height: 320px;
    }

    .promotion-content {
        padding: 1.25rem 1.5rem 1.75rem !important;
        gap: 0.4rem !important;
    }
    
    .promotion-title {
        font-size: 1.6rem !important;
    }
    
    .promotion-price {
        font-size: 1.3rem !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .idine-promotions-track,
    .promotion-card,
    .promotion-image-wrapper img,
    .idine-slider-control,
    .idine-promotions-pagination button {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ====== Modal for Read More ====== */
.idine-promo-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.idine-promo-modal.is-open {
    display: flex;
}
.idine-promo-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.idine-promo-modal__dialog {
    position: relative;
    max-width: min(960px, 92vw);
    max-height: 88vh;
    overflow: auto;
    background: linear-gradient(180deg, rgba(17, 34, 34, 0.98) 0%, rgba(10, 20, 20, 0.98) 100%);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid rgba(250, 186, 19, 0.25);
}
.idine-promo-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(250, 186, 19, 0.65);
    background: rgba(8, 20, 20, 0.35);
    color: #faba13;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}
.idine-promo-modal__content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.idine-promo-modal__image img {
    width: 100%;
    height: auto;
    border-radius: 12px;
}
.idine-promo-modal__title {
    font-family: "Cormorant Garamond", serif;
    color: #ffffff;
    font-size: clamp(1.6rem, 3vw, 2rem);
    margin: 0 0 0.25rem 0;
}
.idine-promo-modal__price {
    color: #faba13;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
}
.idine-promo-modal__desc {
    color: #d9d9d9;
    line-height: 1.65;
}
@media (min-width: 900px) {
    .idine-promo-modal__content {
        grid-template-columns: 1fr 1.1fr;
        gap: 1.25rem;
        align-items: start;
    }
}

/* Prevent background scroll when modal is open */
body.idine-modal-open {
    overflow: hidden;
}
