/* Product Page Styles */

/* Breadcrumbs */
.breadcrumbs {
    background-color: var(--bg-white);
    padding: 15px 0;
    border-bottom: 1px solid var(--border-light);
}

.breadcrumbs .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.breadcrumbs ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    font-size: 14px;
    color: var(--text-medium);
}

.breadcrumbs ul li {
    display: flex;
    align-items: center;
}

.breadcrumbs ul li:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
    color: var(--text-light);
}

.breadcrumbs ul li a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs ul li a:hover {
    text-decoration: underline;
}

.breadcrumbs ul li:last-child {
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Product Header */
.product-header {
    background-color: var(--bg-white);
    padding: 25px 0;
    border-bottom: 1px solid var(--border-light);
}

.product-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.product-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.product-title h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
    max-width: 70%;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-preview-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.live-preview-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    border: 1px solid var(--border-medium);
    background-color: var(--bg-white);
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wishlist-btn:hover, .wishlist-btn.active {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.wishlist-btn.active i {
    color: var(--danger-color);
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: var(--text-light);
}

.product-meta i {
    margin-right: 5px;
}

/* Product Content */
.product-content {
    padding: 40px 0 60px;
    background-color: var(--bg-primary);
}

.product-content .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Product Info */
.product-info {
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
}

/* Product Navigation */
.product-nav {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
}

.product-nav ul {
    display: flex;
    list-style: none;
    padding: 0 20px;
}

.product-nav li {
    position: relative;
}

.product-nav li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    color: var(--text-medium);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
}

.product-nav li a i {
    color: var(--text-light);
}

.product-nav li.active a,
.product-nav li:hover a {
    color: var(--primary-color);
}

.product-nav li.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background-color: var(--primary-color);
}

/* Product Gallery */
.product-gallery {
    padding: 20px;
}

.main-image {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px var(--shadow-color);
}

.main-image img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-actions {
    display: flex;
    gap: 15px;
}

.gallery-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preview-btn {
    background-color: var(--primary-color);
    color: var(--bg-white);
}

.preview-btn:hover {
    background-color: var(--primary-dark);
}

.screenshots-btn {
    background-color: var(--bg-secondary);
    color: var(--text-dark);
}

.screenshots-btn:hover {
    background-color: #e5e5e5;
}

/* Product Description */
.product-description {
    padding: 30px 20px;
}

.product-description h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 25px 0 15px;
}

.product-description p {
    color: var(--text-medium);
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 15px;
}

/* Product Sidebar */
.product-sidebar {
    align-self: start;
}

.product-pricing {
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
    margin-bottom: 20px;
}

.license-option {
    padding: 25px;
}

/* License Option Header */
.license-option h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.license-terms {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.license-terms i {
    font-size: 12px;
}

.license-terms:hover {
    text-decoration: underline;
}

.license-list {
    margin-bottom: 25px;
}

.license-item, .support-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px 0;
    cursor: pointer;
}

.license-item:not(:last-child), 
.support-item:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.radio-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    cursor: pointer;
}

.radio-container label {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.radio-container input[type="radio"] {
    margin-right: 10px;
    accent-color: var(--primary-color);
    width: 18px;
    height: 18px;
    cursor: pointer;
    position: relative;
    top: -1px;
}

.radio-container input[type="radio"]:checked + label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Highlight the entire row when selected */
.license-item.selected,
.support-item.selected {
    background-color: var(--primary-light);
    border-radius: 6px;
    padding: 15px;
    margin: 0 -15px;
    transition: all 0.2s ease;
}

/* Remove the :has selector approach */
.license-item:has(input[type="radio"]:checked),
.support-item:has(input[type="radio"]:checked) {
    background-color: transparent;
    border-radius: 0;
    padding: 15px 0;
    margin: 0;
}

.license-desc {
    color: var(--text-light);
    font-size: 13px;
    display: block;
}

.license-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.original-price {
    font-size: 14px;
    text-decoration: line-through;
    color: var(--text-light);
    margin-bottom: 3px;
}

.sale-price {
    font-weight: 600;
    font-size: 18px;
    color: var(--success-color);
}

.support-price {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
}

.support-options {
    margin-bottom: 25px;
}

/* Total Price Section */
.total-price-section {
    background-color: var(--primary-light);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.total-price-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-price-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.total-price-amount {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.purchase-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.add-to-cart-btn, .buy-now-btn {
    width: 100%;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: var(--bg-white);
    border: none;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-dark);
}

.buy-now-btn {
    background-color: var(--bg-white);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.buy-now-btn:hover {
    background-color: var(--primary-light);
}

.item-features {
    background-color: var(--bg-white);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.item-features ul {
    list-style: none;
}

.item-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-medium);
    font-size: 14px;
}

.item-features li i {
    color: var(--success-color);
}

.item-meta {
    background-color: var(--bg-white);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-medium);
    font-size: 14px;
}

.meta-item i {
    color: var(--text-light);
    width: 20px;
}

.meta-value {
    color: var(--text-dark);
    font-weight: 500;
}

/* Related Items Section */
.related-items {
    padding: 60px 0;
    background-color: var(--bg-white);
}

.related-items .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.related-items .section-header {
    text-align: center;
    margin-bottom: 40px;
}

.related-items .section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.related-items .section-header p {
    font-size: 16px;
    color: var(--text-light);
}

/* Image Overlay Gallery */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-overlay.active {
    opacity: 1;
    visibility: visible;
}

.overlay-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
}

.overlay-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    z-index: 10000;
}

.close-overlay {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.2s ease, transform 0.2s ease;
}

.close-overlay:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.image-carousel {
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
}

.carousel-container {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.carousel-slide {
    min-width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    position: relative;
}

.carousel-slide img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

/* Image loading fade effect */
.carousel-slide.loading img {
    opacity: 0.5;
}

/* Add animations for slide transitions */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.carousel-slide img {
    animation: fadeIn 0.5s ease;
}

.carousel-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 10px;
    color: #fff;
}

.prev-btn, .next-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prev-btn:hover, .next-btn:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

.image-counter {
    font-size: 18px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 20px;
}

/* Enable overlay trigger from product image */
.main-image img {
    cursor: pointer;
    transition: all 0.3s ease;
}

.main-image img:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Responsive styles for the gallery overlay */
@media screen and (max-width: 768px) {
    .overlay-content {
        width: 95%;
    }
    
    .carousel-slide img {
        max-height: 70vh;
    }
    
    .close-overlay {
        top: -35px;
        right: 0;
    }
}

@media screen and (max-width: 576px) {
    .carousel-navigation {
        padding: 15px 0;
    }
    
    .prev-btn, .next-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .close-overlay {
        top: -30px;
        font-size: 20px;
    }
}

/* Responsive Styles */
@media screen and (max-width: 992px) {
    .product-layout {
        grid-template-columns: 1fr;
    }
    
    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media screen and (max-width: 768px) {
    .product-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .product-title h1 {
        max-width: 100%;
        font-size: 24px;
    }
    
    .product-actions {
        width: 100%;
    }
    
    .live-preview-btn {
        flex: 1;
    }
    
    .product-nav ul {
        overflow-x: auto;
        white-space: nowrap;
        padding: 0;
    }
    
    .product-nav li a {
        padding: 15px 15px;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 576px) {
    .product-nav li a {
        font-size: 14px;
        padding: 15px 10px;
    }
    
    .product-nav li a i {
        display: none;
    }
    
    .gallery-actions {
        flex-direction: column;
    }
    
    .license-item, .support-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .license-price, .support-price {
        align-self: flex-end;
    }
}

/* Cart Page Styles */
.cart-section {
    padding: 40px 0 60px;
    background-color: var(--bg-primary);
}

.cart-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.cart-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 30px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Cart Items */
.cart-items {
    background-color: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.cart-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 60px;
    padding: 15px 20px;
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    border-bottom: 1px solid var(--border-light);
}

.cart-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr 60px;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    transition: all 0.3s ease;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-product-col {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-product-image {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.cart-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-product-info h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 350px;
}

.product-author {
    font-size: 13px;
    color: var(--text-light);
}

.product-author a {
    color: var(--primary-color);
    text-decoration: none;
}

.product-author a:hover {
    text-decoration: underline;
}

.license-badge, .support-badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.support-badge {
    background-color: #f0f8ff;
    color: var(--text-medium);
}

.item-price {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
}

.remove-item-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-secondary);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-item-btn:hover {
    background-color: var(--danger-color);
    color: var(--bg-white);
}

/* Empty Cart */
.empty-cart {
    padding: 60px 20px;
    text-align: center;
}

.empty-cart-content i {
    font-size: 50px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-cart-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.empty-cart-content p {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 25px;
}

.browse-templates-btn {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--primary-color);
    color: var(--bg-white);
    font-size: 14px;
    font-weight: 500;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.browse-templates-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Cart Summary */
.cart-summary {
    background-color: var(--bg-white);
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 100px;
}

.cart-summary h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 25px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 15px;
    color: var(--text-medium);
}

.summary-divider {
    height: 1px;
    background-color: var(--border-light);
    margin: 15px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.checkout-btn {
    width: 100%;
    padding: 14px 0;
    background-color: var(--primary-color);
    color: var(--bg-white);
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.checkout-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(62, 99, 237, 0.3);
}

.continue-shopping {
    text-align: center;
    margin-bottom: 25px;
}

.continue-shopping a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.continue-shopping a:hover {
    text-decoration: underline;
}

.payment-methods {
    border-top: 1px solid var(--border-light);
    padding-top: 20px;
}

.payment-methods p {
    font-size: 14px;
    color: var(--text-medium);
    margin-bottom: 10px;
}

.payment-icons {
    display: flex;
    gap: 10px;
    font-size: 24px;
    color: var(--text-medium);
}

/* Responsive Styles for Cart Page */
@media screen and (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: static;
        margin-top: 30px;
    }
}

@media screen and (max-width: 768px) {
    .cart-header {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 15px;
        position: relative;
        padding: 20px;
    }
    
    .cart-product-col {
        grid-column: 1 / -1;
    }
    
    .cart-license-col, 
    .cart-support-col {
        display: inline-block;
        margin-right: 10px;
    }
    
    .cart-price-col {
        font-size: 18px;
        font-weight: 600;
    }
    
    .cart-action-col {
        position: absolute;
        top: 20px;
        right: 20px;
    }
}

@media screen and (max-width: 576px) {
    .cart-title {
        font-size: 24px;
    }
    
    .cart-product-info h3 {
        max-width: 200px;
    }
}
