:root {
    --ss-primary: var(--primary-color, #e11d48);
    --ss-bg: #09090b;
    --ss-border: rgba(255, 255, 255, 0.08);
    --ss-card-bg: rgba(24, 24, 27, 0.85);
    --ss-font: 'Inter', system-ui, sans-serif;
}

/* Horizontal Stories Bar (Trending Shorts) */
.shopshorts-carousel-section {
    padding: 24px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.04);
    margin-bottom: 30px;
    font-family: var(--ss-font);
}

.shopshorts-carousel-heading {
    font-size: 18px;
    font-weight: 800;
    color: #0f0f12;
    margin-top: 0;
    margin-bottom: 18px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.shopshorts-carousel-scroll {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

.shopshorts-carousel-scroll::-webkit-scrollbar {
    height: 6px;
}

.shopshorts-carousel-scroll::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.shopshorts-story-card {
    flex: 0 0 110px;
    cursor: pointer;
    text-align: center;
}

.story-thumbnail-wrapper {
    position: relative;
    width: 105px;
    height: 155px;
    border-radius: 24px;
    overflow: hidden;
    padding: 3px;
    background: linear-gradient(135deg, var(--ss-primary), #fda4af);
    box-shadow: 0 8px 24px -8px rgba(225, 29, 72, 0.3);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.shopshorts-story-card:hover .story-thumbnail-wrapper {
    transform: translateY(-4px) scale(1.03);
}

.story-img-container {
    width: 100%;
    height: 100%;
    border-radius: 21px;
    overflow: hidden;
    position: relative;
}

.story-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #f4f4f5;
}

.story-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.story-title {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #3f3f46;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fullscreen Immersive Reels Player Modal */
.shopshorts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--ss-font);
}

.shopshorts-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 9, 11, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.shopshorts-modal-content {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 100%;
    max-height: 860px;
    background: var(--ss-bg);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--ss-border);
    display: flex;
    flex-direction: column;
}

/* Responsive Desktop vs Mobile overrides */
@media (max-width: 500px) {
    .shopshorts-modal-content {
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
    }
}

.shopshorts-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
}

#shopshorts-main-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.shopshorts-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    color: #ffffff;
    font-size: 34px;
    background: rgba(24, 24, 27, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    z-index: 1000;
    transition: background 0.2s, transform 0.2s;
}

.shopshorts-close-btn:hover {
    background: rgba(24, 24, 27, 0.7);
    transform: scale(1.05);
}

/* Floating Controls Layer (Right Side Overlay) */
.shopshorts-floating-controls {
    position: absolute;
    right: 18px;
    bottom: 220px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    z-index: 100;
}

.shopshorts-floating-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.control-btn {
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s;
}

.control-btn i {
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background: rgba(0, 0, 0, 0.65);
    transform: scale(1.08);
}

.control-label {
    font-size: 13px;
    color: #ffffff;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    letter-spacing: -0.01em;
    text-align: center;
}

.like-btn[data-active="true"] {
    background: rgba(0, 0, 0, 0.45);
}

.like-btn[data-active="true"] i {
    color: #ff2d55 !important;
    animation: heartPulse 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Captions & Shoppable Product Snippet (Bottom Overlay) */
.shopshorts-bottom-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px;
    background: linear-gradient(to top, rgba(9,9,9,0.95) 0%, rgba(9,9,9,0.6) 70%, transparent 100%);
    color: #ffffff;
    z-index: 90;
    box-sizing: border-box;
}

.reel-author {
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
    display: inline-block;
    background: linear-gradient(to right, #ffffff, #d4d4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.reel-caption {
    font-size: 13px;
    color: #e4e4e7;
    margin-top: 0;
    margin-bottom: 18px;
    line-height: 1.5;
    font-weight: 500;
}

/* Shoppable Product Mini-Card */
.shopshorts-product-mini-card {
    background: var(--ss-card-bg);
    border: 1px solid var(--ss-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.mini-product-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.05);
}

.mini-product-info {
    flex: 1;
    overflow: hidden;
}

.mini-product-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-product-price {
    font-size: 12px;
    color: var(--ss-primary);
    font-weight: 800;
    margin-top: 2px;
    display: inline-block;
}

.shopshorts-shop-cta {
    background: var(--ss-primary);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
    transition: transform 0.2s, background 0.2s;
}

.shopshorts-shop-cta:hover {
    transform: translateY(-2px);
    background: #be123c;
}

/* Dynamic Expandable Drawers (Drawer Stack) */
.shopshorts-product-drawer,
.shopshorts-comments-drawer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #18181b;
    border-top: 1px solid var(--ss-border);
    border-radius: 26px 26px 0 0;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 200;
    box-shadow: 0 -15px 40px rgba(0,0,0,0.5);
    box-sizing: border-box;
}

.shopshorts-product-drawer.drawer-open,
.shopshorts-comments-drawer.drawer-open {
    transform: translateY(0);
}

.drawer-handle-bar,
.comments-handle-bar {
    width: 44px;
    height: 5px;
    background: #3f3f46;
    border-radius: 10px;
    margin: 14px auto;
    cursor: pointer;
}

.drawer-content,
.comments-drawer-content {
    padding: 0 24px 28px 24px;
    color: #ffffff;
}

/* Product Detail Drawer Elements */
.drawer-product-flex {
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
}

.drawer-product-img {
    width: 86px;
    height: 86px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--ss-border);
}

.drawer-product-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.drawer-product-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 6px 0;
    line-height: 1.4;
    color: #ffffff;
}

.drawer-product-price {
    color: var(--ss-primary);
    font-size: 19px;
    font-weight: 800;
}

.drawer-product-desc {
    font-size: 13.5px;
    color: #a1a1aa;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 24px;
}

.drawer-action-row {
    display: flex;
    gap: 14px;
}

.drawer-view-details-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: #27272a;
    border: 1px solid var(--ss-border);
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.drawer-view-details-btn:hover {
    background: #3f3f46;
}

.drawer-atc-btn {
    flex: 1;
    background: var(--ss-primary);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(225, 29, 72, 0.3);
    transition: background 0.2s, transform 0.2s;
}

.drawer-atc-btn:hover {
    background: #be123c;
    transform: translateY(-2px);
}

/* Comments Drawer Styles */
.comments-drawer-title {
    font-size: 16px;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 16px;
    color: #ffffff;
}

.comments-list-wrapper {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.comment-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #27272a;
}

.comment-bubble {
    flex: 1;
}

.comment-username {
    font-size: 12px;
    font-weight: 700;
    color: #a1a1aa;
    margin-bottom: 3px;
    display: inline-block;
}

.comment-time {
    font-size: 10px;
    color: #71717a;
    margin-left: 6px;
    font-weight: 500;
}

.comment-text {
    font-size: 12.5px;
    color: #e4e4e7;
    margin: 0;
    line-height: 1.45;
}

.comments-form-row {
    display: flex;
    gap: 10px;
    border-top: 1px solid var(--ss-border);
    padding-top: 16px;
}

.comments-input-field {
    flex: 1;
    background: #27272a;
    border: 1px solid var(--ss-border);
    border-radius: 12px;
    padding: 10px 14px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
}

.comments-input-field:focus {
    border-color: var(--ss-primary);
}

.comments-post-btn {
    background: var(--ss-primary);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0 16px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

/* Animations */
@keyframes heartPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.35); }
    100% { transform: scale(1); }
}

/* Grid of reels list page */
.shopshorts-grid-section {
    padding: 30px 0;
    font-family: var(--ss-font);
}

.shopshorts-grid-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 9/16;
    background: #09090b;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 24px;
}

.shopshorts-grid-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.shopshorts-grid-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.shopshorts-grid-card:hover .shopshorts-grid-thumbnail {
    transform: scale(1.05);
}

.shopshorts-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.85) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    box-sizing: border-box;
}

.shopshorts-grid-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.shopshorts-grid-card:hover .shopshorts-grid-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.shopshorts-grid-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shopshorts-grid-desc {
    font-size: 11px;
    color: #d4d4d8;
    line-height: 1.4;
    height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 10px;
}

.shopshorts-grid-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 8px;
    margin-top: 4px;
}

.shopshorts-grid-stats {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: #a1a1aa;
    font-weight: 600;
}

.shopshorts-grid-product {
    font-size: 10px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Seekable Video Progress Bar styles */
.shopshorts-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 102;
    cursor: pointer;
    transition: height 0.15s ease, background 0.15s ease;
}
.shopshorts-progress-container:hover {
    height: 8px;
    background: rgba(255, 255, 255, 0.35);
}
.shopshorts-progress-fill {
    height: 100%;
    width: 0%;
    background: var(--ss-primary, #e11d48);
    transition: width 0.1s linear;
}

/* Center Play/Pause Overlay Indicator */
.shopshorts-play-pause-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.4);
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    pointer-events: none; /* Let clicks pass through directly to the video element */
    opacity: 0;
    z-index: 101;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.shopshorts-play-pause-overlay.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}
.shopshorts-play-pause-overlay i {
    margin-left: 4px; /* Offset standard triangle play icon centering slightly */
}
