/* Product Page Styles */
.frosted-page {
    margin: 0px;
    background: linear-gradient(135deg, #dfb9de, #ebdae0, #d2c2d5);
}

.vivid-gradient-bg {
    border-radius: 20px;
    padding: 16px;
}

.filter-section {
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    border: 1px solid rgba(255, 255, 255, 0.29);
}

.product-image-container{
    border-radius:1rem !important;
}

.product-card {
    background: rgba(255, 255, 255, 0) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(0px) !important;
    -webkit-backdrop-filter: blur(0px) !important;
    border: 1px solid rgba(255, 255, 255, 0.29) !important;
    padding: 5px !important;
}

.product-item{
    background: rgba(255, 255, 255, 0) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(0px) !important;
    -webkit-backdrop-filter: blur(0px) !important;
    border: 1px solid rgba(255, 255, 255, 0.29) !important;
}

.product-page {
    margin-top: 140px; 
    margin-top: var(--header-height, 140px); 
    padding: 20px 0;
}

.page-header {
    background: #f8f9fa;
    padding: 20px 0;
    margin-bottom: 30px;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.breadcrumb a {
    color: #492248;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.product-title {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 10px 0;
}


.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.clear-all {
    color: #492248;
    text-decoration: none;
    font-size: 14px;
}

.clear-all:hover {
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.checkbox-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.checkbox-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.checkbox-list input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.checkbox-list label {
    margin: 0;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.product-count {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.29) !important;
    backdrop-filter: blur(0px) !important;
    -webkit-backdrop-filter: blur(0px) !important;
}

.sort-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sort-dropdown {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.29) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1) !important;
    backdrop-filter: blur(0px) !important;
    -webkit-backdrop-filter: blur(0px) !important;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    aspect-ratio: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #ffffff;
}

.product-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-images {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: #f8f9fa;
}

/* iOS Safari tweaks: ensure media fills and centers to avoid top gap */
@supports (-webkit-touch-callout: none) {
    .carousel-image,
    .product-image,
    .carousel-image video {
        object-fit: cover !important;
        object-position: center center !important;
        display: block;
        border-radius: inherit; /* ensure media inherits container rounding on iOS */
    }
    /* Propagate rounding and clip through nested wrappers on iOS */
    .product-card,
    .product-image-container,
    .product-carousel,
    .carousel-images {
        border-radius: 16px !important;
        overflow: hidden;
    }
    /* Ensure bottom padding is honored on iOS within square cards */
    .product-image-container {
        box-sizing: border-box;
        padding-bottom: 10px; /* same visual padding as other platforms */
        border-radius: 16px !important; /* match card rounding */
        overflow: hidden; /* clip media to rounded corners */
        -webkit-mask-image: -webkit-radial-gradient(white, black); /* force proper clipping on iOS */
        mask-image: radial-gradient(white, black);
        background-clip: padding-box;
    }
    /* Spacer element to force visual gap below media in iOS */
    .product-image-container::after {
        content: "";
        display: block;
        height: 10px;
    }
}

.carousel-image.active {
    opacity: 1;
}

/* Video specific styles */
.carousel-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    outline: none;
}

.carousel-image video::-webkit-media-controls {
    display: none !important;
}

.carousel-image video::-webkit-media-controls-panel {
    display: none !important;
}

.carousel-image video::-webkit-media-controls-play-button {
    display: none !important;
}

.carousel-image video::-webkit-media-controls-timeline {
    display: none !important;
}

.carousel-image video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.carousel-image video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.carousel-image video::-webkit-media-controls-mute-button {
    display: none !important;
}

.carousel-image video::-webkit-media-controls-volume-slider {
    display: none !important;
}

.carousel-image video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.gallery-main-media {
    position: relative;
    width: 100%;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 10px 0;
    min-height: 400px;
}

.gallery-main-media::before {
    content: "Loading media...";
    position: absolute;
    color: #666;
    font-size: 16px;
    z-index: 1;
}

.gallery-main-media:not(:empty)::before {
    display: none;
}

.gallery-main-media .carousel-image {
    z-index: 2;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.gallery-main-media video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: none;
    outline: none;
}

.gallery-main-media video::-webkit-media-controls {
    display: none !important;
}

.gallery-main-media video::-webkit-media-controls-panel {
    display: none !important;
}

.gallery-main-media video::-webkit-media-controls-play-button {
    display: none !important;
}

.gallery-main-media video::-webkit-media-controls-timeline {
    display: none !important;
}

.gallery-main-media video::-webkit-media-controls-current-time-display {
    display: none !important;
}

.gallery-main-media video::-webkit-media-controls-time-remaining-display {
    display: none !important;
}

.gallery-main-media video::-webkit-media-controls-mute-button {
    display: none !important;
}

.gallery-main-media video::-webkit-media-controls-volume-slider {
    display: none !important;
}

.gallery-main-media video::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.gallery-main-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.gallery-thumbnail-container {
    position: relative;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
}

.gallery-thumbnail-container:hover {
    opacity: 1;
}

.gallery-thumbnail-container.active {
    opacity: 1;
    border-color: #492248;
}

.gallery-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    display: block;
}

.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    pointer-events: none;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.carousel-prev,
.carousel-next {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #492248;
    font-size: 12px;
}

.product-carousel:hover .carousel-prev,
.product-carousel:hover .carousel-next {
    opacity: 1;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 255, 255, 1);
}

/* Hide arrows on mobile screens */
@media (max-width: 768px) {
    .carousel-nav {
        display: none;
    }
}

.gallery-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(73, 34, 72, 0.85);
    color: white;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.2s ease;
    font-size: 11px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gallery-btn:hover {
    background: rgba(73, 34, 72, 1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.media-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

.media-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.media-dot.active {
    background: rgba(255, 255, 255, 1);
}

.media-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Gallery Modal Styles */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.gallery-content {
    position: relative;
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
}

.gallery-header {
    padding: 15px 20px 10px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.gallery-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.gallery-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    z-index: 1;
}

.gallery-main {
    padding: 20px;
    text-align: center;
}

.gallery-main-image,
.gallery-main-media .carousel-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.gallery-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding: 10px 20px 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    border: 2px solid transparent;
}

.gallery-thumbnail:hover {
    opacity: 1;
}

.gallery-thumbnail.active {
    opacity: 1;
    border-color: #492248;
}

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.badge-bestseller {
    background: #ffd700;
    color: #333;
}

.badge-latest {
    background: #28a745;
    color: #fff;
}

.badge-trending {
    background: #dc3545;
    color: #fff;
}

.badge-engravable {
    background: #6c757d;
    color: #fff;
}

.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
}

.action-btn {
    background: transparent;
    color: #492248;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.action-btn:hover {
    color: #ab50aa;
}

.product-item {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
}

.product-info {
    padding: 10px 12px;
    text-align: left;
}

.product-price {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.product-original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.product-name {
    font-size: 13px;
    color: #666;
    margin-bottom: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
}

.delivery-info {
    font-size: 12px;
    color: #492248;
    text-decoration: none;
}

.delivery-info:hover {
    text-decoration: underline;
}

.sub-nav {
    background: #f8f9fa;
    padding: 15px 0;
    margin-bottom: 20px;
}

.sub-nav-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.sub-nav-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sub-nav-btn.active,
.sub-nav-btn:hover {
    background: #492248;
    color: #fff;
}

.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #492248;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(73, 34, 72, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.floating-btn:hover {
    transform: scale(1.1);
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .product-page {
        margin-top: 100px; /* Reduced margin for mobile */
        padding: 15px 0;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .filter-section {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .product-page {
        margin-top: 80px; /* Even smaller margin for small mobile */
        padding: 10px 0;
    }
    
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .product-card {
        font-size: 12px;
    }
    
    .product-info {
        padding: 8px;
    }
    
    .product-price {
        font-size: 14px;
    }
    
    .product-name {
        font-size: 11px;
    }
}

/* Mobile Filter Modal */
.mobile-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
}

.mobile-filter-modal {
    position: fixed;
    top: 0;
    left: -100%;
    width: 90%;
    max-width: 400px;
    height: 100%;
    background: white;
    z-index: 2001;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-filter-modal.active {
    left: 0;
}

.mobile-filter-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.mobile-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.mobile-filter-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.mobile-filter-categories {
    width: 40%;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}

.mobile-filter-options {
    width: 60%;
    padding: 20px;
    overflow-y: auto;
}

.mobile-filter-category {
    padding: 15px 20px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #333;
}

.mobile-filter-category.active {
    background: #492248;
    color: white;
}

.mobile-filter-category:hover {
    background: #f0f0f0;
}

.mobile-filter-category.active:hover {
    background: #492248;
}

.mobile-filter-option {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-filter-option input[type="checkbox"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.mobile-filter-option label {
    flex: 1;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.mobile-filter-option .count {
    color: #666;
    font-size: 12px;
}

.mobile-filter-actions {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.mobile-filter-clear {
    flex: 1;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.mobile-filter-apply {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #492248, #ab50aa);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.mobile-filter-trigger {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #492248;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(73, 34, 72, 0.3);
}

#SizeFilterGroup {
    display: none;
}

#MobileSizeCategoryBtn {
    display: none;
}

.product-item {
    cursor: pointer;
}

/* Count styling for filter options */
.filter-count {
    color: #888;
}


@media (max-width: 991px) {
    .mobile-filter-trigger {
        display: block;
    }
    
    .filter-section {
        display: none;
    }
}
