/* Main responsive styles */
:root {
    --primary: #fcba05;
    --primary-dark: #dfd00a;
    --secondary: #222222;
    --text-color: #333333;
    --text-light: #777777;
    --light-bg: #f6f6f6;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

/* Page wrapper structure */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content-wrapper {
    flex: 1;
    padding: 20px 0;
}

@media (min-width: 768px) {
    .main-content-wrapper {
        padding: 20px 0;
    }
}

/* Container widths for different screen sizes */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
  }
}

/* Product View Container - mobile first */
.product-view-container {
    display: block;
    padding: 0;
    margin: 0 auto;
    max-width: 100%;
}

/* Switch to grid layout on larger screens */
@media (min-width: 992px) {
    .product-view-container {
        display: grid;
        grid-template-columns: 60% 40%;
        gap: 40px;
        padding: 0;
    }
}

/* Full-width elements in the grid */
.tabs-section, 
.related-products,
.subcategory-showcase {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 30px;
}

/* Product Image Section */
.product-image-wrapper {
    width: 100%;
    margin-bottom: 20px;
}

.product-image-container {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    padding-top: 75%; /* 4:3 Aspect ratio */
    /* background-color: #fff; */
    /* box-shadow: var(--shadow); */
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s;
}

/* Thumbnail Gallery */
.thumbnail-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

@media (min-width: 576px) {
    .thumbnail-gallery {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }
}

.thumbnail {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    opacity: 0.7;
}

.thumbnail.active {
    border-color: var(--primary);
    opacity: 1;
}

.thumbnail:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.thumbnail img {
    width: 100%;
    height: 60px;
    object-fit: cover;
}

@media (min-width: 768px) {
    .thumbnail img {
        height: 70px;
    }
}

/* Product Details Section */
.product-info {
    width: 100%;
}

.product-title {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 10px;
    word-wrap: break-word;
}

@media (min-width: 768px) {
    .product-title {
        font-size: 24px;
    }
}

@media (min-width: 992px) {
    .product-title {
        font-size: 28px;
    }
}

.short-description {
    margin-bottom: 20px;
    color: var(--text-light);
    line-height: 1.6;
    font-size: 14px;
}

@media (min-width: 768px) {
    .short-description {
        font-size: 15px;
        margin-bottom: 25px;
    }
}

/* Product Rating */
.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.product-rating .rating-stars {
    color: #FFD700;
    font-size: 16px;
    margin-right: 10px;
}

.product-rating .rating-text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* Price Section */
.price-section {
    padding: 15px;
    margin: 15px 20px 15px 0px;
    border-radius: 8px;
    background-color: var(--light-bg);
}

@media (min-width: 768px) {
    .price-section {
        padding: 20px;
    }
}

/* Buy Button */
.buy-button {
    background-color: var(--primary);
    color: var(--secondary) !important;
    border: none;
    border-radius: 30px;
    padding: 12px 20px;
    width: 100%;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    margin-top: 15px;
    text-decoration: none;
    text-align: center;
}

@media (min-width: 768px) {
    .buy-button {
        padding: 15px 25px;
        font-size: 16px;
        margin-top: 20px;
    }
}

/* File Formats */
.file-formats {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .file-formats {
        gap: 12px;
        margin: 20px 0;
    }
}

.format-badge {
    background-color: var(--light-bg);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

@media (min-width: 768px) {
    .format-badge {
        padding: 8px 15px;
        font-size: 13px;
    }
}

/* Author Section */
.author-section {
    margin: 20px 0;
}

.author-section .card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.05);
}

.author-section .card-body {
    padding: 15px;
}

.author-container {
    display: flex;
    flex-direction: column;
}

.author-info-wrapper {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

/* Fix author avatar size to match content height */
.author-avatar {
    width: 64px;
    height: 64px;
    margin-right: 15px;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff;
}

.author-info {
    min-width: 0;
    flex: 1;
}

/* Author name wrapper with buttons */
.author-name-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    width: 100%;
}

.author-name-wrapper h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.author-name-wrapper h5 a {
    color: #333;
    text-decoration: none;
}

.author-since {
    font-size: 12px;
    color: #777;
    margin-bottom: 8px;
}

/* Move buttons to author name line */
.author-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.follow-btn, 
.profile-btn, 
.edit-profile-btn, 
.login-follow-btn {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background-color: var(--primary);
    color: var(--secondary);
    border: none;
    cursor: pointer;
    pointer-events: auto;
    user-select: auto;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.follow-btn i, 
.profile-btn i, 
.edit-profile-btn i, 
.login-follow-btn i {
    margin-right: 4px;
    font-size: 12px;
}

.profile-btn {
    background-color: #f6f6f6;
    color: #333;
}

/* Make stats horizontal */
.author-stats {
    display: flex;
    flex-direction: row;
    gap: 15px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.author-stat {
    display: flex;
    align-items: center;
}

.stat-content {
    display: flex;
    align-items: center;
}

.stat-content i {
    color: var(--primary);
    margin-right: 6px;
    font-size: 14px;
}

.stat-text {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    color: #333;
}

.stat-label {
    font-size: 12px;
    color: #777;
    line-height: 1;
}

/* Fix button actions */
.author-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.follow-btn, 
.profile-btn, 
.edit-profile-btn, 
.login-follow-btn {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background-color: var(--primary);
    color: var(--secondary);
    border: none;
    cursor: pointer;
    pointer-events: auto;
    user-select: auto;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.profile-btn {
    background-color: #f6f6f6;
    color: #333;
}

@media (min-width: 768px) {
    .author-section .card-body {
        padding: 20px;
    }
    
    .author-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .author-actions {
        margin-top: 0;
        flex-shrink: 0;
    }
}

/* Fix for button clickability */
.buy-button {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 2;
    position: relative;
}

#addToWishlistBtn {
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 2;
    position: relative;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.stat-item {
    background-color: var(--light-bg);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.stat-item .stat-value {
    font-weight: 700;
    font-size: 18px;
    color: var(--secondary);
    margin-bottom: 3px;
}

.stat-item .stat-label {
    font-size: 13px;
    color: var(--text-light);
}

/* Info Section */
.info-section {
    margin: 20px 0;
    border-top: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.info-value {
    color: var(--text-light);
    font-size: 14px;
    text-align: right;
}

/* Tabs Section */
.tabs-section {
    margin-top: 30px;
}

.tab-navigation {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -15px;
    padding: 0 15px;
}

.tab-navigation::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .tab-navigation {
        margin: 0;
        padding: 0;
        overflow-x: visible;
    }
}

.tab {
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    font-size: 14px;
}

@media (min-width: 768px) {
    .tab {
        padding: 12px 20px;
        font-size: 15px;
    }
}

.tab.active {
    color: var(--secondary);
    border-bottom-color: var(--primary);
}

.tab:hover {
    color: var(--secondary);
}

.tab-content {
    margin-top: 20px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Action Row */
.action-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .action-row {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.favorites-button {
    background-color: var(--light-bg);
    color: var(--text-color);
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    width: 100%;
}

@media (min-width: 768px) {
    .favorites-button {
        width: auto;
    }
}

.favorites-button:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
}

.favorites-button i {
    margin-right: 5px;
    color: #ff5555;
}

.share-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

@media (min-width: 768px) {
    .share-section {
        justify-content: flex-start;
    }
}

.share-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
}

.share-icons {
    display: flex;
    gap: 10px;
}

.share-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: var(--transition);
}

.share-icon:hover {
    background-color: var(--primary);
    color: var(--secondary);
    transform: translateY(-2px);
}

/* Description */
.description {
    margin: 20px 0;
    line-height: 1.6;
    color: var(--text-color);
    font-size: 14px;
    overflow-wrap: break-word;
}

@media (min-width: 768px) {
    .description {
        font-size: 15px;
    }
}

.description img,
.description video,
.description iframe {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.feature-list {
    list-style-type: none;
    padding: 0;
    margin: 20px 0;
}

.feature-list li {
    padding: 8px 0 8px 25px;
    position: relative;
    line-height: 1.5;
}

.feature-list li::before {
    content: "\f00c";
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 8px;
    color: var(--primary);
}

.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 20px 0;
}

/* YouTube Container */
.youtube-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    margin: 20px 0;
}

.youtube-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: none;
}

/* Terms Tab */
.terms-heading {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--secondary);
}

.terms-subheading {
    margin-top: 25px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--secondary);
}

.terms-footer {
    margin-top: 30px;
    font-style: italic;
    color: var(--text-light);
}

/* Support Tab */
.support-heading {
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 700;
    color: var(--secondary);
}

.support-intro {
    margin-bottom: 20px;
    color: var(--text-color);
}

.faq-heading {
    margin-top: 30px;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--secondary);
}

.faq-item {
    margin-bottom: 20px;
}

.faq-question {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
}

.faq-answer {
    color: var(--text-light);
    margin: 0;
}

/* Related Products */
.related-products {
    margin: 40px 0;
}

.section-heading {
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 700;
    color: var(--secondary);
    font-size: 20px;
}

@media (min-width: 768px) {
    .section-heading {
        font-size: 24px;
    }
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

@media (min-width: 576px) {
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (min-width: 992px) {
    .related-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

.related-item {
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.related-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.related-image-wrapper {
    position: relative;
    padding-top: 75%; /* 4:3 Aspect Ratio */
}

.related-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-content {
    padding: 12px;
}

.related-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
}

/* Subcategory Showcase */
.subcategory-showcase {
    margin: 40px 0;
    position: relative;
}

.subcategory-slider-container {
    position: relative;
}

.subcategory-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
}

.subcategory-slider::-webkit-scrollbar {
    display: none;
}

@media (min-width: 768px) {
    .subcategory-slider {
        gap: 15px;
    }
}

.subcategory-item {
    scroll-snap-align: start;
    min-width: 140px;
    text-decoration: none;
}

@media (min-width: 576px) {
    .subcategory-item {
        min-width: 160px;
    }
}

@media (min-width: 768px) {
    .subcategory-item {
        min-width: 180px;
    }
}

.subcategory-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.subcategory-item:hover .subcategory-card {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.subcategory-icon {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 10px;
}

.subcategory-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.subcategory-label {
    font-size: 12px;
    color: var(--text-light);
    padding: 3px 8px;
    border-radius: 12px;
    background-color: var(--light-bg);
}

.subcategory-label.current {
    background-color: var(--primary);
    color: var(--secondary);
}

.active-subcategory .subcategory-card {
    border: 2px solid var(--primary);
}

.subcategory-nav {
    display: none;
}

@media (min-width: 768px) {
    .subcategory-nav {
        display: block;
    }
    
    .subcategory-nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background-color: var(--white);
        color: var(--text-color);
        border: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        z-index: 2;
    }
    
    .subcategory-nav-btn:hover {
        background-color: var(--primary);
        color: var(--secondary);
    }
    
    .subcategory-nav-btn.prev {
        left: -15px;
    }
    
    .subcategory-nav-btn.next {
        right: -15px;
    }
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Message notifications */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 9999;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s forwards;
    max-width: calc(100% - 40px);
}

@media (min-width: 768px) {
    .message {
        max-width: 300px;
    }
}

.message.success {
    background-color: #4CAF50;
    color: white;
}

.message.error {
    background-color: #f44336;
    color: white;
}

@keyframes slideIn {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive margin and padding utilities */
@media (max-width: 767px) {
    .mb-sm-0 { margin-bottom: 0 !important; }
    .mb-sm-1 { margin-bottom: 0.25rem !important; }
    .mb-sm-2 { margin-bottom: 0.5rem !important; }
    .mb-sm-3 { margin-bottom: 1rem !important; }
    .mb-sm-4 { margin-bottom: 1.5rem !important; }
    .mb-sm-5 { margin-bottom: 3rem !important; }
    
    .mt-sm-0 { margin-top: 0 !important; }
    .mt-sm-1 { margin-top: 0.25rem !important; }
    .mt-sm-2 { margin-top: 0.5rem !important; }
    .mt-sm-3 { margin-top: 1rem !important; }
    .mt-sm-4 { margin-top: 1.5rem !important; }
    .mt-sm-5 { margin-top: 3rem !important; }
    
    .px-sm-0 { padding-left: 0 !important; padding-right: 0 !important; }
    .px-sm-1 { padding-left: 0.25rem !important; padding-right: 0.25rem !important; }
    .px-sm-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
    .px-sm-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
    .px-sm-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
    .px-sm-5 { padding-left: 3rem !important; padding-right: 3rem !important; }
}

@media (min-width: 768px) {
    .mb-md-0 { margin-bottom: 0 !important; }
    .mb-md-1 { margin-bottom: 0.25rem !important; }
    .mb-md-2 { margin-bottom: 0.5rem !important; }
    .mb-md-3 { margin-bottom: 1rem !important; }
    .mb-md-4 { margin-bottom: 1.5rem !important; }
    .mb-md-5 { margin-bottom: 3rem !important; }
    
    .mt-md-0 { margin-top: 0 !important; }
    .mt-md-1 { margin-top: 0.25rem !important; }
    .mt-md-2 { margin-top: 0.5rem !important; }
    .mt-md-3 { margin-top: 1rem !important; }
    .mt-md-4 { margin-top: 1.5rem !important; }
    .mt-md-5 { margin-top: 3rem !important; }
}

/* This is to ensure smooth scrolling throughout the site */
html {
    scroll-behavior: smooth;
}

/* Fix for iOS Safari vertical content overflow issues */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
  .deal-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
  }

  .offer-list::-webkit-scrollbar {
  width: 6px;
}
.offer-list::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}
.offer-list::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}