/* ============================================
   PRODUCT DETAIL PAGE STYLES
   ============================================ */

/* Gilroy Font for Product Detail Page - Loaded via base.html */

/* Apply Gilroy font to all product detail page elements */
.product_detail_page,
.product_detail_page *,
.product-detail-container,
.product-detail-container * {
    font-family: 'Gilroy', 'Montserrat', sans-serif !important;
}

.product_detail_page {
    background: #F5F5F5;
}

/* Remove white background from parent containers */
.product_detail_page .maxwidth-theme,
.product_detail_page .container_inner,
.product_detail_page .wrapper_inner {
    background: transparent !important;
    background-color: transparent !important;
}

/* Align breadcrumbs with product title */
/* Product title is inside .product-detail-container which has padding: 32px */
/* Breadcrumbs need to have the same left padding to align with the title */
.product_detail_page .container_inner {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Remove padding from breadcrumbs maxwidth-theme */
.product_detail_page .breadcrumbs .maxwidth-theme {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure product detail container maxwidth-theme aligns with breadcrumbs */
.product_detail_page > .container_inner > .maxwidth-theme {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Align breadcrumbs with catalog button in header */
/* Catalog button is at left: 72.5px, breadcrumbs are at left: 56.5px */
/* Difference: 16px, so we need to add 16px padding to breadcrumbs */
.product_detail_page .breadcrumbs {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.product_detail_page .breadcrumbs .maxwidth-theme {
    padding-left: 16px !important;
    padding-right: 0 !important;
}

.product-detail-container {
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 12px;
    padding: 32px;
    margin: 20px auto;
    max-width: 1200px;
    box-shadow: none !important;
}

/* Breadcrumbs - styles moved to breadcrumbs.css */

/* Product Main Section */
.product-main-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

/* Product Gallery */
.product-gallery {
    position: sticky;
    top: 20px;
}

.product-gallery-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #F8F8F8;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

.product-main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.product-sale-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #EE2722;
    border-radius: 32px;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.sale-badge-text {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    line-height: 120%;
    color: #FFFFFF;
    white-space: nowrap;
}

.sale-badge-percent {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 16px;
    line-height: 120%;
    color: #FFFFFF;
}

/* Gallery Thumbnails */
.product-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.gallery-thumb-item {
    aspect-ratio: 1;
    background: #F8F8F8;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    position: relative;
}

.gallery-thumb-item:hover {
    border-color: #EE2722;
    transform: scale(1.05);
}

.gallery-thumb-item.active {
    border-color: #EE2722;
}

.gallery-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Product Info */
.product-info {
    display: flex;
    flex-direction: column;
}

.product-info-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Product Title */
.product-title {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 30px;
    line-height: 130%;
    color: #231F20;
    margin: 0 0 8px 0;
}

/* Article */
.product-article {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-size: 14px;
    color: #666666;
}

.article-label {
    font-weight: 400;
}

.article-value {
    font-weight: 500;
    color: #231F20;
}

/* Stock Status */
.product-stock {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stock-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stock-indicator.in-stock {
    background: #4CAF50;
}

.stock-indicator.low-stock {
    background: #FF9800;
}

.stock-indicator.out-of-stock {
    background: #F44336;
}

.stock-text {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 120%;
    color: #231F20;
}

/* Price Block */
.product-price-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-value {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 36px;
    line-height: 120%;
    color: #231F20;
}

.price-currency {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 24px;
    line-height: 120%;
    color: #231F20;
}

.price-old {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.old-price-value {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 20px;
    line-height: 120%;
    color: #999999;
    text-decoration: line-through;
}

.old-price-currency {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    line-height: 120%;
    color: #999999;
    text-decoration: line-through;
}

/* Short Description */
.product-short-description {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 15px;
    line-height: 160%;
    color: #666666;
    padding: 16px 20px;
    background: #F8F8F8;
    border-radius: 10px;
    margin-top: 4px;
}

.product-short-description p {
    margin: 0;
}

.product-short-description p:not(:last-child) {
    margin-bottom: 12px;
}

/* Buy Block */
.product-buy-block {
    display: flex;
    gap: 16px;
    align-items: center;
}

.quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    overflow: hidden;
    background: #FFFFFF;
}

.quantity-btn {
    width: 44px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #231F20;
    transition: background-color 0.2s ease;
    padding: 0;
    border-radius: 20px;
}

.quantity-btn:hover {
    background: #F5F5F5;
}

.quantity-btn:active {
    background: #E0E0E0;
}

.quantity-input {
    width: 60px;
    height: 48px;
    border: none;
    border-left: 1px solid #E0E0E0;
    border-right: 1px solid #E0E0E0;
    text-align: center;
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #231F20;
    background: #FFFFFF;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-add-to-cart {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #EE2722;
    border: none;
    border-radius: 20px;
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
    line-height: 120%;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 20px;
    white-space: nowrap;
    min-width: 160px;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: #D01E1A;
    transform: translateY(-2px);
    box-shadow: 0px 4px 8px rgba(238, 39, 34, 0.3);
}

.btn-add-to-cart:active:not(:disabled) {
    transform: translateY(0);
}

.btn-add-to-cart:disabled {
    background: #CCCCCC;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-add-to-cart .cart-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* Product Actions */
.product-actions {
    display: flex;
    gap: 12px;
}

.product-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 120%;
    color: #231F20;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-action-btn:hover {
    border-color: #EE2722;
    color: #EE2722;
    background: #FFF5F5;
}

.product-action-btn.active {
    border-color: #EE2722;
    background: #EE2722;
    color: #FFFFFF;
}

.product-action-btn.active:hover {
    background: #D01E1A;
    border-color: #D01E1A;
}

.product-action-btn .action-icon {
    width: 18px;
    height: 18px;
    display: block;
    transition: filter 0.3s ease;
}

.product-action-btn.wishlist-btn .action-icon,
.product-action-btn.wishlist-btn .heart-icon-img {
    filter: brightness(0) saturate(100%) invert(18%) sepia(95%) saturate(7151%) hue-rotate(352deg) brightness(95%) contrast(93%);
}

.product-action-btn.wishlist-btn.active .action-icon,
.product-action-btn.wishlist-btn.active .heart-icon-img {
    filter: brightness(0) saturate(100%) invert(18%) sepia(95%) saturate(7151%) hue-rotate(352deg) brightness(95%) contrast(93%);
    opacity: 1;
}

.product-action-btn.active .action-icon {
    filter: brightness(0) invert(1);
}

/* Product Badges */
.product-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 12px;
    line-height: 120%;
    white-space: nowrap;
}

.badge-new {
    background: #4CAF50;
    color: #FFFFFF;
}

.badge-hit {
    background: #FF9800;
    color: #FFFFFF;
}

.badge-recommended {
    background: #2196F3;
    color: #FFFFFF;
}

/* Description Section */
.product-description-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #E5E5E5;
}

.section-title {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 24px;
    line-height: 120%;
    color: #231F20;
    margin: 0 0 24px 0;
}

.product-description {
    font-family: 'Gilroy', 'Montserrat', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    color: #666666;
}

.product-description p {
    margin: 0 0 16px 0;
}

.product-description p:last-child {
    margin-bottom: 0;
}

.product-description ul,
.product-description ol {
    margin: 0 0 16px 0;
    padding-left: 24px;
}

.product-description li {
    margin-bottom: 8px;
}

/* Related Products Section */
.related-products-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid #E5E5E5;
}

.related-products-section .products-grid-new {
    margin-top: 24px;
    justify-items: start;
    gap: 12px !important;
    row-gap: 12px !important;
    column-gap: 12px !important;
}

/* Force gap override for related products with higher specificity */
body .related-products-section .products-grid-new,
body .related-products-section div.products-grid-new {
    gap: 12px !important;
    row-gap: 12px !important;
    column-gap: 12px !important;
}

.related-products-section .product-card-new {
    width: 100%;
    max-width: 228px;
}

/* Image fade transition */
.product-main-image {
    transition: opacity 0.3s ease;
    cursor: zoom-in;
}

/* Zoom icon on hover */
.product-gallery-main {
    position: relative;
    cursor: zoom-in;
    user-select: none;
    -webkit-user-select: none;
}

.product-gallery-main::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 19C15.4183 19 19 15.4183 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19Z' stroke='%23231F20' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M21 21L16.65 16.65' stroke='%23231F20' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 28px 28px;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.15);
}

.product-gallery-main:hover::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05);
}

.product-gallery-main:hover .product-main-image {
    opacity: 0.85;
}

/* Image Modal */
.image-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #FFFFFF;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    z-index: 10001;
}

.image-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .product-detail-container {
        padding: 28px;
        max-width: 100%;
    }
    
    .product-main-section {
        gap: 36px;
    }
    
    .product-title {
        font-size: 28px;
    }
    
    .price-value {
        font-size: 32px;
    }
    
    .price-currency {
        font-size: 22px;
    }
    
    .product-info-content {
        gap: 18px;
    }
}

@media (max-width: 968px) {
    .product-detail-container {
        padding: 24px;
    }
    
    .product-main-section {
        grid-template-columns: 1fr;
        gap: 32px;
        margin-bottom: 32px;
    }
    
    .product-gallery {
        position: static;
    }
    
    .product-gallery-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
    
    .product-info-content {
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .product-detail-container {
        padding: 20px;
        margin: 10px auto;
        border-radius: 10px;
    }
    
    .product-main-section {
        gap: 28px;
        margin-bottom: 32px;
    }
    
    .product-gallery-main {
        margin-bottom: 14px;
        border-radius: 10px;
    }
    
    .product-title {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    .price-value {
        font-size: 28px;
    }
    
    .price-currency {
        font-size: 20px;
    }
    
    .old-price-value {
        font-size: 18px;
    }
    
    .product-info-content {
        gap: 16px;
    }
    
    .product-buy-block {
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
    }
    
    .quantity-selector {
        flex-shrink: 0;
        border-radius: 20px;
        border: 2px solid #E5E5E5;
    }
    
    .quantity-btn {
        width: 48px;
        height: 50px;
    }
    
    .quantity-input {
        width: 70px;
        height: 50px;
        font-size: 16px;
        font-weight: 600;
    }
    
    .btn-add-to-cart {
        flex: 1;
        min-width: auto;
        font-size: 15px;
        font-weight: 600;
        padding: 0 20px;
        height: 50px;
        border-radius: 20px;
        box-shadow: 0 4px 12px rgba(238, 39, 34, 0.25);
    }
    
    .btn-add-to-cart .cart-icon {
        width: 20px;
        height: 20px;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .product-action-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 18px;
    }
    
    .product-short-description {
        padding: 14px 18px;
        font-size: 14px;
    }
    
    .product-description-section,
    .related-products-section {
        margin-top: 32px;
        padding-top: 28px;
    }
    
    .section-title {
        font-size: 20px;
        margin-bottom: 18px;
    }
    
    .product-gallery-thumbs {
        grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .product-detail-container {
        padding: 16px;
        margin: 10px auto;
        border-radius: 10px;
    }
    
    .product-main-section {
        gap: 24px;
        margin-bottom: 28px;
    }
    
    .product-gallery-main {
        margin-bottom: 12px;
        border-radius: 10px;
    }
    
    .product-title {
        font-size: 22px;
        margin-bottom: 6px;
        line-height: 130%;
    }
    
    .product-info-content {
        gap: 16px;
    }
    
    .price-value {
        font-size: 26px;
    }
    
    .price-currency {
        font-size: 18px;
    }
    
    .old-price-value {
        font-size: 16px;
    }
    
    .product-short-description {
        font-size: 14px;
        padding: 14px 16px;
        border-radius: 8px;
    }
    
    .product-buy-block {
        flex-direction: row;
        gap: 10px;
        width: 100%;
        align-items: stretch;
    }
    
    .quantity-selector {
        flex-shrink: 0;
        width: auto;
        border-radius: 20px;
        border: 1px solid #E5E5E5;
        background: #FFFFFF;
        min-width: 100px;
        max-width: 110px;
    }
    
    .quantity-btn {
        width: 36px;
        height: 48px;
        background: transparent;
        transition: background-color 0.2s ease;
    }
    
    .quantity-btn:hover {
        background: #F5F5F5;
    }
    
    .quantity-btn:active {
        background: #E5E5E5;
    }
    
    .quantity-input {
        width: 40px;
        height: 48px;
        font-size: 15px;
        font-weight: 500;
        color: #231F20;
        border-left: 1px solid #E5E5E5;
        border-right: 1px solid #E5E5E5;
        padding: 0;
    }
    
    .btn-add-to-cart {
        flex: 1;
        width: 100%;
        height: 48px;
        font-size: 16px;
        font-weight: 600;
        padding: 0 16px;
        min-width: auto;
        border-radius: 20px;
        box-shadow: 0 4px 12px rgba(238, 39, 34, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .btn-add-to-cart:active:not(:disabled) {
        transform: scale(0.98);
        box-shadow: 0 2px 8px rgba(238, 39, 34, 0.25);
    }
    
    .btn-add-to-cart .cart-icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    
    .btn-add-to-cart span {
        font-weight: 600;
        white-space: nowrap;
    }
    
    .product-action-btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .product-description-section,
    .related-products-section {
        margin-top: 28px;
        padding-top: 24px;
    }
    
    .section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .product-description {
        font-size: 14px;
        line-height: 160%;
    }
    
    .product-gallery-thumbs {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .gallery-thumb-item {
        border-radius: 8px;
    }
}
