/**
 * TWTC Coffee Beans Carousel Styles
 */

/* Section container */
.twtc-beans-carousel {
    --carousel-max-width: 1280px;
    --carousel-gap: 1.5rem;
    margin-top: 3rem;
    max-width: var(--carousel-max-width);
    margin-left: auto;
    margin-right: auto;
}

/* Section title */
.twtc-carousel-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #18181b;
}

/* Track container - hides overflow but allows shadow to show */
.twtc-carousel-track-container {
    overflow: hidden;
    padding-bottom: 1rem;
    margin-bottom: -1rem;
}

/* Track - holds all cards in a row */
.twtc-carousel-track {
    display: flex;
    gap: var(--carousel-gap);
    transition: transform 0.3s ease-out;
}

/* Individual card - fixed width based on 1280px max */
.twtc-bean-card {
    /* 4 cards: (1280 - 3*24) / 4 = 302px */
    flex: 0 0 calc((var(--carousel-max-width) - 3 * var(--carousel-gap)) / 4);
    max-width: calc((var(--carousel-max-width) - 3 * var(--carousel-gap)) / 4);
    display: flex;
    flex-direction: column;
    border: 1px solid #d4c4a8;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.twtc-bean-card:hover {
    /* shadow-lg equivalent */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* Image container - square aspect ratio */
.twtc-bean-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    background: #f4f4f5;
    overflow: hidden;
}

.twtc-bean-image a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.twtc-bean-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.twtc-bean-image:hover img {
    transform: scale(1.05);
}

/* No image placeholder */
.twtc-bean-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f4f4f5;
    text-align: center;
}

.twtc-bean-no-image-icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 0.5rem;
    background: #e4e4e7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.twtc-bean-no-image-icon span {
    font-size: 1.5rem;
}

.twtc-bean-no-image p {
    color: #a1a1aa;
    font-size: 0.875rem;
    margin: 0;
}

/* Card content */
.twtc-bean-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Roaster link */
.twtc-bean-roaster {
    margin-bottom: 0.25rem;
}

.twtc-bean-roaster a {
    font-size: 0.875rem;
    color: #52525b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.twtc-bean-roaster a:hover {
    color: #18181b;
}

/* Bean name */
.twtc-bean-name a {
    text-decoration: none;
}

.twtc-bean-name p {
    font-weight: 600;
    font-size: 1.125rem;
    line-height: 1.25;
    color: #18181b;
    margin: 0 0 0.25rem 0;
    transition: color 0.2s ease;
}

.twtc-bean-name a:hover p {
    color: #3f3f46;
}

/* Region */
.twtc-bean-region p {
    font-size: 0.875rem;
    color: #71717a;
    margin: 0;
}

/* Actions */
.twtc-bean-actions {
    margin-top: auto;
    padding-top: 1.25rem;
    display: flex;
    align-items: center;
}

/* View button - styled like template */
.twtc-bean-view-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
    color: #18181b;
    background: transparent;
    border: 1px solid #d4c4a8;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
    min-width: 33.333%;
}

.twtc-bean-view-btn:hover {
    background-color: #faf7f2;
}

/* Navigation - centered below track */
.twtc-carousel-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.twtc-carousel-nav button {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #d4c4a8;
    border-radius: 50%;
    cursor: pointer;
    color: #52525b;
    transition: all 0.2s ease;
    padding: 0;
}

.twtc-carousel-nav button:hover:not(:disabled) {
    background: #faf7f2;
    color: #18181b;
}

.twtc-carousel-nav button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.twtc-carousel-nav button svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* Hide nav when nothing to navigate */
.twtc-carousel-nav.is-hidden {
    display: none;
}

/* Error/placeholder states */
.twtc-carousel-error,
.twtc-carousel-placeholder {
    padding: 2rem;
    text-align: center;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 0.5rem;
    color: #92400e;
}

.twtc-carousel-placeholder {
    background: #f4f4f5;
    border-color: #e4e4e7;
    color: #71717a;
}

/* Responsive: On smaller screens, show fewer cards */
@media (max-width: 1023px) {
    .twtc-bean-card {
        /* 2 cards */
        flex: 0 0 calc((100% - var(--carousel-gap)) / 2);
        max-width: calc((100% - var(--carousel-gap)) / 2);
    }
}

@media (max-width: 767px) {
    .twtc-bean-card {
        /* 1 card */
        flex: 0 0 100%;
        max-width: 100%;
    }
}
