/* Product Page Styles */
.product-page {
    padding: 2rem 0;
    min-height: 60vh;
}

.product-detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Product Images Section */
.product-images-section {
    position: relative;
}

.main-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    cursor: crosshair;
    background: #f9f9f9;
}

.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
}

/* Image Zoom Effect - Mouse following */
.main-image-container.zooming .main-product-image {
    transform: scale(1.3);
    transition: transform 0.1s ease-out;
}

/* Thumbnails */
.product-thumbnails {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.thumbnail-item {
    width: 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9f9f9;
}

.thumbnail-item:hover {
    border-color: #007bff;
}

.thumbnail-item.active {
    border-color: #007bff;
    border-width: 3px;
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Product Details Section */
.product-details-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.product-name {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
    text-transform: none !important;
}

html[dir="rtl"] .product-name {
    text-align: right !important;
}

html[dir="ltr"] .product-name {
    text-align: left !important;
}

/* Price Section */
.product-price-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-price {
    font-size: 2rem;
    font-weight: 700;
    color: #007bff;
}

.old-price {
    font-size: 1.5rem;
    color: #999;
    text-decoration: line-through;
}

.price-note {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Description */
.product-description {
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
}

.product-description ul,
.product-description ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.product-description li {
    margin: 0.25rem 0;
}

/* Product Options */
.product-option {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option-label {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    margin: 0;
}

/* Color Variants */
.color-variants {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.color-variant-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-variant-btn:hover:not(.disabled) {
    border-color: #007bff;
    transform: scale(1.1);
}

.color-variant-btn.active {
    border-color: #007bff;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.color-variant-btn.disabled,
.color-variant-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.color-inner {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: inherit;
}

.selected-color-name {
    font-size: 0.95rem;
    color: #666;
    margin-top: 0.25rem;
}

/* Capacity Variants */
.capacity-variants {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.capacity-variant-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.capacity-variant-btn:hover:not(.disabled) {
    border-color: #007bff;
    background: #f8f9fa;
}

.capacity-variant-btn.active {
    border-color: #007bff;
    background: #e7f3ff;
}

.capacity-variant-btn.disabled,
.capacity-variant-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    background: #f5f5f5;
}

.capacity-name {
    font-weight: 500;
    color: #333;
}

.capacity-price {
    font-weight: 600;
    color: #007bff;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    width: fit-content;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background: #e9ecef;
}

.quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Buy Now Button */
.buy-now-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.buy-now-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.buy-now-btn:active {
    transform: translateY(0);
}

.buy-now-btn svg {
    width: 20px;
    height: 20px;
}

/* Product Tabs Section */
.product-tabs-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.product-tabs-header {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
}

.product-tab-btn {
    padding: 1rem 2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.product-tab-btn:hover {
    color: #007bff;
    background: #f8f9fa;
}

.product-tab-btn.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.product-tabs-content {
    position: relative;
    min-height: 200px;
}

.product-tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-empty-message {
    padding: 3rem 1rem;
    text-align: center;
    color: #666;
}

.tab-empty-message p {
    margin: 0;
    font-size: 1rem;
}

/* Attributes Section */
.product-attributes-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
}

.attributes-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.attribute-item {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.attribute-name {
    font-weight: 600;
    color: #333;
}

.attribute-value {
    color: #666;
}

/* Gallery Section */
.product-gallery-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Full Width Gallery (Overview Gallery) */
.gallery-grid-full {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gallery-item-full {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease;
}

.gallery-item-full:hover {
    transform: scale(1.02);
}

.gallery-image-full {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Responsive Design */
@media (max-width: 992px) {
    .product-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .product-name {
        font-size: 1.75rem;
    }
    
    .current-price {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .product-page {
        padding: 1rem 0;
    }
    
    .product-name {
        font-size: 1.5rem;
    }
    
    .current-price {
        font-size: 1.5rem;
    }
    
    .old-price {
        font-size: 1.25rem;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .color-variant-btn {
        width: 45px;
        height: 45px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .product-tab-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

/* Dark Mode Styles */
html.dark .main-image-container {
    border-color: var(--border-color);
    background: #1e293b;
}

html.dark .thumbnail-item {
    background: #1e293b;
    border-color: var(--border-color);
}

html.dark .thumbnail-item:hover {
    border-color: var(--primary-color);
}

html.dark .thumbnail-item.active {
    border-color: var(--primary-color);
}

html.dark .product-name {
    color: var(--text-primary);
}

html.dark .old-price {
    color: var(--text-secondary);
}

html.dark .price-note {
    color: var(--text-secondary);
}

html.dark .product-description {
    color: var(--text-secondary);
}

html.dark .option-label {
    color: var(--text-primary);
}

html.dark .color-variant-btn {
    border-color: var(--border-color);
}

html.dark .color-variant-btn:hover:not(.disabled) {
    border-color: var(--primary-color);
}

html.dark .color-variant-btn.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

html.dark .selected-color-name {
    color: var(--text-secondary);
}

html.dark .capacity-variant-btn {
    border-color: var(--border-color);
    background: #1e293b;
}

html.dark .capacity-variant-btn:hover:not(.disabled) {
    border-color: var(--primary-color);
    background: #334155;
}

html.dark .capacity-variant-btn.active {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

html.dark .capacity-variant-btn.disabled {
    background: #0f172a;
}

html.dark .capacity-name {
    color: var(--text-primary);
}

html.dark .capacity-price {
    color: var(--primary-color);
}

html.dark .quantity-selector {
    border-color: var(--border-color);
}

html.dark .quantity-btn {
    background: #1e293b;
    color: var(--text-primary);
    border-color: var(--border-color);
}

html.dark .quantity-btn:hover {
    background: #334155;
}

html.dark .quantity-input {
    border-color: var(--border-color);
    background: #1e293b;
    color: var(--text-primary);
}

html.dark .product-tabs-section {
    border-top-color: var(--border-color);
}

html.dark .product-tabs-header {
    border-bottom-color: var(--border-color);
}

html.dark .product-tab-btn {
    color: var(--text-secondary);
}

html.dark .product-tab-btn:hover {
    color: var(--primary-color);
    background: #1e293b;
}

html.dark .product-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

html.dark .tab-empty-message {
    color: var(--text-secondary);
}

html.dark .product-attributes-section {
    border-top-color: transparent;
}

html.dark .section-title {
    color: var(--text-primary);
}

html.dark .attribute-item {
    background: #1e293b;
}

html.dark .attribute-name {
    color: var(--text-primary);
}

html.dark .attribute-value {
    color: var(--text-secondary);
}

html.dark .product-gallery-section {
    border-top-color: transparent;
}

html.dark .gallery-item {
    border-color: var(--border-color);
}

html.dark .gallery-item-full {
    border-color: var(--border-color);
}

/* Gift Items */
.gift-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.gift-item-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease;
}

.gift-item-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.gift-item-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f9f9f9;
}

.gift-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gift-item-details {
    padding: 0.75rem;
}

.gift-item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.gift-item-price {
    margin-bottom: 0.5rem;
}

.gift-item-price .old-price {
    font-size: 0.85rem;
    color: #999;
    text-decoration: line-through;
}

.gift-item-color {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gift-item-color .color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: inline-block;
}

html.dark .gift-item-card {
    background: var(--content-bg);
    border-color: var(--border-color);
}

html.dark .gift-item-card:hover {
    border-color: var(--primary-color);
}

html.dark .gift-item-name {
    color: var(--text-primary);
}

html.dark .gift-item-price .old-price {
    color: var(--text-secondary);
}

html.dark .gift-item-color .color-indicator {
    border-color: var(--border-color);
}

/* Gift Items List (Horizontal Layout: Image | Name | Price) */
.gift-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.gift-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.gift-item-row:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.1);
}

.gift-item-image-small {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
}

.gift-item-image-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gift-item-image-small .no-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-item-image-small .no-image-placeholder::after {
    content: '📦';
    font-size: 1.5rem;
    opacity: 0.3;
}

.gift-item-name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.gift-item-price {
    flex-shrink: 0;
    text-align: right;
    min-width: 100px;
}

.gift-item-price .gift-price {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
}

.gift-item-price .old-price {
    font-size: 0.95rem;
    color: #999;
    text-decoration: line-through;
}

html.dark .gift-item-row {
    background: var(--content-bg);
    border-color: var(--border-color);
}

html.dark .gift-item-row:hover {
    border-color: var(--primary-color);
}

html.dark .gift-item-image-small {
    background: #1e293b;
    border-color: var(--border-color);
}

html.dark .gift-item-image-small .no-image-placeholder {
    background: #1e293b;
}

html.dark .gift-item-name {
    color: var(--text-primary);
}

html.dark .gift-item-price .gift-price {
    color: var(--text-primary);
}

html.dark .gift-item-price .old-price {
    color: var(--text-secondary);
}

/* Variant Selection Styles */
.variants-option {
    margin: 1.5rem 0;
}

.product-variants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.variant-selection-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.variant-selection-btn:hover {
    border-color: #0066cc;
    background: #f0f7ff;
}

.variant-selection-btn.active {
    border-color: #0066cc;
    background: #e6f2ff;
}

.variant-selection-btn .variant-name {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
    margin-bottom: 4px;
}

.variant-selection-btn .variant-price {
    font-size: 16px;
    color: #0066cc;
    font-weight: 700;
}

.variant-selection-btn .variant-stock {
    margin-top: 4px;
}

.selected-variant-name {
    margin-top: 0.75rem;
    font-weight: 600;
    color: #212529;
}

/* Dark mode support */
html.dark .variant-selection-btn {
    background: #2d3748;
    border-color: #4a5568;
}

html.dark .variant-selection-btn:hover {
    border-color: #3b82f6;
    background: #1e293b;
}

html.dark .variant-selection-btn.active {
    border-color: #3b82f6;
    background: #1e3a5f;
}

html.dark .variant-selection-btn .variant-name,
html.dark .selected-variant-name {
    color: #f8fafc;
}

html.dark .variant-selection-btn .variant-price {
    color: #60a5fa;
}
