/**
 * Stone Showcase Carousel - Frontend Styles
 * Version: 1.2.0
 * Updated: Fixed height info section, right-aligned thickness badges
 */

/* ===================================
   CSS Custom Properties
   =================================== */
:root {
    --ssc-item-width: 196px;
    --ssc-item-height: 420px;
    --ssc-info-height: 160px;
    --ssc-info-bg: rgba(255, 255, 255, 0.75);
    --ssc-info-blur: 4px;
    --ssc-text-primary: #1a1a2e;
    --ssc-text-secondary: #4a5568;
    --ssc-border-color: #d1d5db;
    --ssc-badge-bg: rgba(255, 255, 255, 0.95);
    --ssc-thickness-bg: rgba(0, 0, 0, 0.15);
}

/* ===================================
   Carousel Wrapper
   =================================== */
.ssc-carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0;
    background-color: transparent;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.ssc-carousel-wrapper:active {
    cursor: grabbing;
}

.ssc-carousel-wrapper * {
    box-sizing: border-box;
}

/* ===================================
   Carousel Track
   =================================== */
.ssc-carousel-track {
    display: flex;
    gap: 0;
    will-change: transform;
    transition: transform 0.1s ease-out;
}

.ssc-carousel-track.ssc-dragging {
    transition: none;
}

.ssc-carousel-track.ssc-animating {
    transition: transform 0.5s ease-out;
}

/* ===================================
   Carousel Item
   =================================== */
.ssc-carousel-item {
    flex: 0 0 auto;
    width: var(--ssc-item-width);
    height: var(--ssc-item-height);
    position: relative;
    overflow: hidden;
}

/* ===================================
   Image Container - Full Height
   =================================== */
.ssc-item-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #e5e7eb;
}

.ssc-item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.4s ease;
}

.ssc-image-normal {
    opacity: 1;
}

.ssc-image-hover {
    opacity: 0;
}

.ssc-carousel-item:hover .ssc-image-normal {
    opacity: 0;
}

.ssc-carousel-item:hover .ssc-image-hover {
    opacity: 1;
}

/* ===================================
   Material Badge (top left) - Smaller, font-weight 400
   =================================== */
.ssc-material-badge {
    position: absolute;
	line-height:20px;
    top: 10px;
    left: 10px;
    z-index: 10;
    padding: 0px 8px;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--ssc-text-primary);
    background-color: var(--ssc-badge-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ===================================
   Floating Info Overlay - FIXED HEIGHT
   =================================== */
.ssc-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--ssc-info-height);
    padding: 16px 14px;
    background: var(--ssc-info-bg);
    backdrop-filter: blur(var(--ssc-info-blur));
    -webkit-backdrop-filter: blur(var(--ssc-info-blur));
    z-index: 5;
    display: flex;
    flex-direction: column;
}

/* ===================================
   Item Title - Fixed area with ellipsis, font-weight 400
   =================================== */
.ssc-item-title {
    margin: 0 0 auto 0;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    color: var(--ssc-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    /* Limit to 2 lines max */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 38px;
    max-height: 38px;
}

/* ===================================
   Thickness Badges - Right aligned, smaller, space above button
   =================================== */
.ssc-thickness-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 8px;
    min-height: 15px;
}

.ssc-thickness-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0px 8px;
	line-height:20px;
    font-size: 11px;
    font-weight: 400;
    color: var(--ssc-text-secondary);
    background-color: var(--ssc-thickness-bg);
    border: none;
    border-radius: 3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ===================================
   More Info Button - Smaller padding, 3px letter-spacing
   =================================== */
.ssc-more-info-btn {
    display: block;
    width: 100%;
    padding: 0px 12px;
    font-size: 12px;
	line-height:25px;
    font-weight: 500;
    letter-spacing: 3px;
    text-align: center;
    text-decoration: none;
    color: #5a7d9a;
    background-color: transparent;
    border: 1px solid #35647E;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin-top: auto;
    flex-shrink: 0;
}

.ssc-more-info-btn:hover {
    color: #3d5a73;
    background-color: rgba(255, 255, 255, 0.5);
    border-color: #8aa8c4;
    text-decoration: none;
}

.ssc-more-info-btn:focus {
    outline: 2px solid #5a7d9a;
    outline-offset: 2px;
}

/* ===================================
   No Image Placeholder
   =================================== */
.ssc-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    color: #9ca3af;
    font-size: 14px;
}

/* ===================================
   No Items Message
   =================================== */
.ssc-no-items {
    padding: 40px;
    text-align: center;
    color: #6b7280;
    font-size: 16px;
    background-color: #f9fafb;
    border-radius: 8px;
}

/* ===================================
   Responsive Styles
   =================================== */
@media screen and (max-width: 1200px) {
    :root {
        --ssc-item-width: 180px;
        --ssc-item-height: 400px;
        --ssc-info-height: 135px;
    }
}

@media screen and (max-width: 768px) {
    :root {
        --ssc-item-width: 165px;
        --ssc-item-height: 380px;
        --ssc-info-height: 130px;
    }

    .ssc-item-title {
        font-size: 13px;
    }

    .ssc-item-info {
        padding: 14px 12px;
    }

    .ssc-material-badge {
        padding: 3px 10px;
        font-size: 10px;
    }
}

@media screen and (max-width: 480px) {
    :root {
        --ssc-item-width: 150px;
        --ssc-item-height: 350px;
        --ssc-info-height: 125px;
    }

    .ssc-item-title {
        font-size: 12px;
        min-height: 32px;
        max-height: 32px;
    }

    .ssc-thickness-badge {
        font-size: 10px;
        padding: 0px 6px;
		line-height:15px;
    }

    .ssc-more-info-btn {
        padding: 0px 10px;
        font-size: 9px;
        letter-spacing: 2px;
		line-height:20px;
    }

    .ssc-material-badge {
        top: 6px;
        left: 6px;
        padding: 0px 8px;
		line-height:15px;
        font-size: 10px;
    }
}

/* ===================================
   Accessibility
   =================================== */
@media (prefers-reduced-motion: reduce) {
    .ssc-carousel-track,
    .ssc-carousel-item,
    .ssc-item-image,
    .ssc-more-info-btn {
        transition: none;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .ssc-carousel-wrapper {
        overflow: visible;
    }

    .ssc-carousel-track {
        flex-wrap: wrap;
    }

    .ssc-item-info {
        background: #fff;
    }
}
