/* --- პროდუქტის დეტალური გვერდის სტილები (Mobile-First მიდგომით) --- */

/* --- ძირითადი სტრუქტურა --- */
@font-face {
    font-family: 'Alk Sanet';
    src: url('/fonts/alk-sanet.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

.product-single-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 40px;
}

.product-gallery {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* --- მთავარი სურათი და თამბნეილები --- */
.main-image-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: crosshair;
}

.main-image {
    border: 1px solid var(--border-color, #eee);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    aspect-ratio: 1 / 1;
    position: relative;
}
.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
}

/* ✨ სურათის Fade ანიმაცია ✨ */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
    z-index: 10;
}

.fade-out .main-image { position: relative; }
.fade-out .image-overlay { opacity: 1; }

.thumbnail-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.thumbnail-item {
    width: 70px;
    height: 70px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
    padding: 2px;
    overflow: hidden;
    opacity: 0.7;
}
.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}
.thumbnail-item:hover { opacity: 1; transform: scale(1.05); }
.thumbnail-item.active {
    border-color: var(--accent-color, #e67e22);
    opacity: 1;
    transform: scale(1.1);
}

/* --- პროდუქტის დეტალები --- */
.product-title { font-family: var(--font-primary); font-size: 1.8rem; margin-bottom: 5px; line-height: 1.3; }

/* 🍊 ფასის ბლოკი 🍊 */
.price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 15px;
    margin-bottom: 10px;
    border-left: 5px solid var(--accent-color, #e67e22);
    padding: 5px 0 5px 10px;
    background-color: transparent;
}

/* 🔥🔥🔥 ODOMETER (სლაიდერის) სტილები 🔥🔥🔥 */
.product-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #333;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
    
    /* ფლექსი, რომ ციფრები გვერდიგვერდ დადგეს */
    display: inline-flex;
    align-items: flex-start;
    /* მალავს ყველაფერს რაც სიმაღლეს სცდება */
    overflow: hidden; 
    /* ფიქსირებული სიმაღლე აუცილებელია სლაიდერისთვის */
    height: 1.1em; 
    line-height: 1.1em;
}

.product-price.sale-price { color: var(--accent-color, #e67e22); }

.product-price.old-price {
    font-size: 1.2rem;
    color: #95a5a6;
    font-weight: 400;
    text-decoration: line-through;
    display: inline-block; /* ძველ ფასზე ანიმაცია არ გვინდა */
}

/* 1. თითოეული ციფრის "ფანჯარა" */
.odometer-digit {
    display: inline-block;
    height: 1em;
    line-height: 1;
    overflow: hidden; /* მალავს დანარჩენ ციფრებს */
    width: 0.6em; /* ციფრის სიგანე */
    position: relative;
    text-align: center;
}

/* 2. სიმბოლოები (. და ₾) - ისინი არ მოძრაობენ */
.odometer-symbol {
    display: inline-block;
    height: 1em;
    line-height: 1;
}

/* 3. ციფრების ლენტი (0-9) */
.odometer-ribbon {
    display: flex;
    flex-direction: column;
    /* ეს აკეთებს სლაიდ ეფექტს */
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); /* Elastic Effect */
    will-change: transform;
}

.odometer-ribbon span {
    height: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 🔥🔥🔥 END ODOMETER 🔥🔥🔥 */


/* --- სტოკის სტატუსი --- */
.stock-status-badge {
    margin-bottom: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.2;
    min-width: 170px;
    justify-content: center;
    font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.stock-status-badge i { margin-right: 6px; font-size: 1rem; }
.in-stock-badge { color: #1a7d47; background-color: #e6f7ef; border: 1px solid #a3d9b8; }
.out-of-stock-badge { color: #c0392b; background-color: #fcebeb; border: 1px solid #e7a3a3; }
.stock-count { font-weight: 400; margin-left: 5px; }

.product-description { line-height: 1.7; color: var(--text-light, #555); font-size: 0.95rem; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif; }

/* --- კალათის ფორმა --- */
.add-to-cart-form {
    display: flex; flex-direction: column; gap: 15px; align-items: stretch; margin-bottom: 20px;
}
.form-actions { display: flex; flex-direction: column; gap: 15px; }
.quantity-selector { display: flex; align-items: center; gap: 0; flex-shrink: 0; }
.quantity-selector label { font-size: 1rem; font-weight: 600; color: #333; margin-right: 10px; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif; }
.quantity-selector input[type="number"] {
    width: 50px; height: 42px; text-align: center; border: 1px solid #ddd;
    border-left: none; border-right: none; font-size: 1rem; font-weight: 600;
    -moz-appearance: textfield; appearance: textfield; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.quantity-selector input::-webkit-outer-spin-button,
.quantity-selector input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.quantity-btn {
    width: 42px; height: 42px; border: 1px solid #ddd; background-color: #f9f9f9;
    cursor: pointer; font-size: 1.5rem; line-height: 1; color: #555; transition: background-color 0.2s;
}
.quantity-btn:hover:not(:disabled) { background-color: #f0f0f0; }
.quantity-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.quantity-minus { border-radius: 5px 0 0 5px; }
.quantity-plus { border-radius: 0 5px 5px 0; }

.add-to-cart-btn {
    flex-grow: 1; background-color: var(--accent-color, #e67e22); color: #fff;
    padding: 12px 20px; border-radius: 5px; font-weight: 700; text-decoration: none;
    border: none; cursor: pointer; transition: background-color 0.3s, transform 0.2s, box-shadow 0.2s;
    font-size: 1rem; display: flex; align-items: center; justify-content: center;
    gap: 8px; width: 100%; height: 42px; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.add-to-cart-btn:hover:not(:disabled) {
    background-color: #d35400; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.add-to-cart-btn:disabled { background-color: #bdc3c7; cursor: not-allowed; }

/* --- ტაბები --- */
.product-info-tabs { width: 100%; }
.tabs-nav { list-style: none; display: flex; gap: 20px; border-bottom: 2px solid #eee; margin-bottom: 25px; padding-left: 0; }
.tab-link {
    padding: 10px 5px; font-size: 1.1rem; font-weight: 600; color: #555; cursor: pointer;
    position: relative; border-bottom: 3px solid transparent; transition: all 0.3s;
    margin-bottom: -2px; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.tab-link.active { color: #222; border-bottom-color: var(--accent-color, #e67e22); }
.tab-pane { display: none; animation: fadeIn 0.5s; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.product-features-table { border-radius: 8px; border: 1px solid #e0e0e0; overflow: hidden; }
.features-grid { display: grid; grid-template-columns: 1fr; }
.feature-item {
    display: flex; justify-content: space-between; padding: 12px 15px; border-top: 1px solid #e0e0e0;
    font-size: 0.95rem; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.feature-item:first-of-type { border-top: none; }
.feature-key { font-weight: 600; color: #555; }
.feature-value { color: #222; text-align: right; }

/* --- ვარიაციის სელექტორი --- */
.product-variants-selector { margin-bottom: 15px; display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.product-variants-selector label { font-weight: 600; color: #333; flex-shrink: 0; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif; }
.variant-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.variant-item { cursor: pointer; transition: all 0.2s ease-in-out; flex-shrink: 0; }

.variant-swatches-image .variant-item {
    width: 50px; height: 50px; padding: 0; border-radius: 50%; overflow: hidden;
    position: relative; border: 2px solid #ddd; background-color: transparent; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.variant-swatches-image .variant-item img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.variant-swatches-image .variant-item.active {
    border-color: var(--accent-color, #e67e22); box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.4); transform: scale(1.05);
}
.variant-swatches-image .variant-item:hover:not(.active) { transform: scale(1.05); border-color: #d35400; }

.variant-swatches-color .variant-item {
    width: 35px; height: 35px; padding: 0; border-radius: 50%; border: 1px solid #ccc;
    background-color: transparent; transition: transform 0.2s, box-shadow 0.2s; display: flex; align-items: center; justify-content: center;
}
.variant-swatches-color .variant-item .color-swatch { display: block; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; box-sizing: border-box; }
.variant-swatches-color .variant-item.active {
    border-color: var(--accent-color, #e67e22); box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.4); transform: scale(1.1);
}
.variant-swatches-color .variant-item:hover:not(.active) { border-color: #aaa; transform: scale(1.05); }

.variant-swatches-text .variant-item {
    min-width: 50px; height: 38px; display: flex; align-items: center; justify-content: center;
    background-color: #f7f7f7; padding: 0 15px; border-radius: 8px; font-size: 0.95rem; font-weight: 500;
    color: #555; border: 1px solid #e0e0e0; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif;
}
.variant-swatches-text .variant-item.active {
    background-color: var(--accent-color, #e67e22); color: #fff; border-color: var(--accent-color, #e67e22); box-shadow: 0 2px 4px rgba(230, 126, 34, 0.2);
}
.variant-swatches-text .variant-item:hover:not(.active) { background-color: #e9e9e9; color: #222; }

/* --- მსგავსი პროდუქტები --- */
.related-products-section { padding: 40px 0; border-top: 1px solid #eee; margin-top: 40px; }
.section-title { font-size: 1.8rem; font-weight: 600; margin-bottom: 30px; color: #374151; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif; }
.related-products-slider { width: 100%; height: auto; padding-bottom: 50px; }
.swiper-slide { display: flex; justify-content: center; align-items: stretch; height: auto; }
.product-card { background-color: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: box-shadow 0.3s ease; overflow: hidden; display: flex; flex-direction: column; width: 100%; height: 100%; }
.product-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.product-card a { text-decoration: none; color: inherit; display: flex; flex-direction: column; flex-grow: 1; }
.product-card__image-wrapper { position: relative; overflow: hidden; aspect-ratio: 1 / 1; background-color: #f5f5f5; }
.discount-badge { position: absolute; top: 10px; left: 10px; background-color: #e74c3c; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 0.85rem; font-weight: 700; z-index: 2; line-height: 1; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif; }
.product-card__image-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.product-card:hover .product-card__image-wrapper img { transform: scale(1.05); }
.product-card__content { padding: 15px; text-align: left; flex-grow: 1; display: flex; flex-direction: column; }
.product-card__title { color: #222; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif; font-size: 1rem; line-height: 1.4; font-weight: 600; height: 2.8em; margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.product-card__price-section { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; padding-top: 10px; gap: 10px; }
.price-container { display: flex; align-items: baseline; gap: 8px; flex-wrap: nowrap; }
.product-card__price { font-size: 1.1rem; font-weight: 700; margin: 0; color: #333; font-family: 'Alk Sanet', 'Noto Sans Georgian', sans-serif; }
.product-card__price.sale-price { color: #e67e22; }
.product-card__price.old-price { font-size: 0.9rem; color: #95a5a6; font-weight: 400; text-decoration: line-through; }
.product-card__cart-btn { background-color: #e67e22; color: white; border: none; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; transition: all 0.2s ease; display: flex; align-items: center; justify-content: center; position: relative; box-shadow: 0 2px 8px rgba(230, 126, 34, 0.3); flex-shrink: 0; }
.product-card__cart-btn::before { content: ''; display: block; width: 100%; height: 100%; background-color: white; -webkit-mask-size: 55%; mask-size: 55%; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; transition: -webkit-mask-image 0.2s ease, mask-image 0.2s ease; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z'/%3E%3C/svg%3E"); }
.product-card__cart-btn:hover { background-color: #d4711e; transform: scale(1.05); box-shadow: 0 4px 12px rgba(230, 126, 34, 0.4); }
.product-card__cart-btn.added { background-color: #10b981; }
.product-card__cart-btn.added::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E"); }
.product-card__cart-btn.error { background-color: #e74c3c; cursor: not-allowed; pointer-events: none; }
.product-card__cart-btn.error::before { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E"); }

.swiper-pagination { bottom: 15px !important; }
.swiper-pagination-bullet { width: 8px; height: 8px; background-color: #d1d5db; opacity: 1; transition: all 0.3s ease-in-out; margin: 0 4px !important; }
.swiper-pagination-bullet-active { width: 24px; border-radius: 6px; background-color: #e67e22; }

@media (min-width: 768px) {
    .product-single-container { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; }
    .product-title { font-size: 2.2rem; }
    .price-wrapper { padding: 5px 0 5px 15px; }
    .product-price { font-size: 2rem; }
    .product-price.old-price { font-size: 1.5rem; }
    /* დესკტოპზე შეიძლება ოდნავ განიერი იყოს */
    .odometer-digit { width: 0.6em; } 
    .form-actions { flex-direction: row; gap: 20px; align-items: center; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) { .product-single-container { gap: 50px; } }
@media (max-width: 767px) {
    .related-products-section .price-container { flex-direction: column; align-items: flex-start; gap: 0; }
    .related-products-section .product-card__price { font-size: 1rem; }
    .related-products-section .product-card__price.sale-price { font-size: 1.05rem; line-height: 1.2; }
    .related-products-section .product-card__price.old-price { font-size: 0.8rem; line-height: 1; }
    .related-products-section .product-card__cart-btn { width: 34px; height: 34px; }
}