/* ==========================================================================
   Product Detail Page - Apple Style Design
   ========================================================================== */

:root {
    --primary: #0071e3;
    --primary-dark: #0055b3;
    --text-dark: #1d1d1f;
    --text-gray: #424245;
    --text-light: #86868b;
    --bg-light: #f5f5f7;
    --bg-white: #ffffff;
    --border: #d2d2d7;
    --success: #34c759;
    --error: #ff3b30;
    --warning: #ff9500;
}

/* Breadcrumbs */
.breadcrumbs {
    background: transparent;
    padding: 12px 0;
}

.breadcrumbs .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.breadcrumbs .breadcrumb-item a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumbs .breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumbs .breadcrumb-item.active {
    color: var(--text-dark);
}

.breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--text-light);
}

/* Product Row - align columns at top */
.container .row.g-4.g-lg-5 {
    align-items: flex-start;
}

/* Gallery Column Wrapper */
.gallery-column {
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Gallery Container */
.product-gallery-container {
    background: white;
    border-radius: 18px;
    padding: 24px;
    position: sticky;
    top: 24px;
    overflow: hidden;
}

/* Info Column - must be above gallery */
.info-column {
    position: relative;
    z-index: 5;
    background: var(--bg-light);
}

/* Ensure info container stays above */
.product-info-container {
    position: relative;
    z-index: 10;
}


.main-image-wrapper {
    position: relative;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-wrapper .main-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: zoom-in;
}

/* Gallery Navigation */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
    z-index: 10;
    transition: all 0.2s;
}

.gallery-nav:hover {
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.gallery-prev {
    left: 16px;
}

.gallery-next {
    right: 16px;
}

/* Thumbnails */
.gallery-thumbnails-wrapper {
    overflow: hidden;
    position: relative;
}

.gallery-thumbnails {
    display: flex;
    gap: 12px;
    padding-bottom: 8px;
    width: max-content;
    transition: transform 0.3s ease;
}

.thumbnail {
    flex: 0 0 80px;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--bg-light);
}

.thumbnail:hover {
    border-color: var(--border);
}

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

/* Product Info Container */
.product-info-container {
    background: white;
    border-radius: 18px;
    padding: 24px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.product-detail-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--error);
    color: white;
    margin-bottom: 16px;
}

.product-detail-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-detail-subtitle {
    font-size: 15px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.product-detail-sku {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
}

/* Price Section */
.product-price-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--bg-light);
}

.product-price-section .price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 8px;
}

.product-price-section .price-current {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

.product-price-section .price-old {
    font-size: 18px;
    color: var(--text-light);
    text-decoration: line-through;
}

.price-savings {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

/* Installment Section */
.installment-section {
    background: var(--bg-light);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.installment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.installment-header:hover {
    background: rgba(0, 0, 0, 0.02);
}

.installment-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.installment-label {
    font-size: 13px;
    color: var(--text-light);
}

.installment-price {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.installment-badge-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.installment-badge {
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.installment-period {
    font-size: 14px;
    color: var(--text-gray);
}

.installment-arrow {
    color: var(--text-light);
    transition: transform 0.3s;
}

.installment-section.expanded .installment-arrow {
    transform: rotate(180deg);
}

.installment-details {
    display: none;
    padding: 0 20px 20px;
}

.installment-section.expanded .installment-details {
    display: block;
}

.installment-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    margin-top: 15px;
}

.installment-table-header,
.installment-table-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 16px;
}

.installment-table-header {
    background: rgba(0, 0, 0, 0.02);
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
}

.installment-table-row .highlight {
    font-weight: 600;
    color: var(--primary);
}

.installment-apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-bottom: 16px;
}

.installment-apply-btn:hover {
    background: var(--primary-dark);
}

.installment-steps {
    background: white;
    border-radius: 10px;
    padding: 16px;
}

.installment-steps-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.installment-steps-header svg {
    color: var(--primary);
}

.installment-steps-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.8;
}

/* Option Sections (Color/Storage) */
.option-section {
    margin-bottom: 24px;
}

.option-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

/* Color Options */
.color-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.color-option {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    overflow: hidden;
    border: 2px solid var(--border);
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.color-option img {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    object-fit: contain !important;
}

.color-option:hover {
    border-color: var(--text-light);
}

.color-option.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
}

/* Color Dots - Samsung Style */
.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: block;
}

.color-dot::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 1;
    border: solid 1px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    box-sizing: border-box;
    transition: border-color 0.2s linear;
}

.color-dot::after {
    content: '';
    display: none;
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid #000;
    border-radius: 50%;
}

.color-dot.active::after {
    display: block;
}

/* Storage Options - Apple Style */
.storage-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.storage-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-dark);
}

.storage-option:hover {
    border-color: var(--text-light);
    color: var(--text-dark);
    text-decoration: none;
}

.storage-option.active {
    border: 2px solid var(--primary);
    background: var(--bg-white);
}

.storage-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.storage-size {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0;
}

.storage-subtitle {
    font-size: 13px;
    color: var(--text-light);
}

.storage-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.storage-price {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
}

.storage-monthly {
    font-size: 12px;
    color: var(--text-light);
}

.storage-option.active .storage-size,
.storage-option.active .storage-price {
    color: var(--text-dark);
}

/* Product Actions */
.product-detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.product-detail-actions .btn-add-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 500;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.product-detail-actions .btn-add-cart:hover {
    background: var(--primary-dark);
}

.btn-icon-action {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-action:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon-action.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-icon-action.add-to-favorites.active {
    background: white;
    border-color: var(--border);
    color: #e63946;
}

/* Delivery Info */
.delivery-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 24px;
    border-top: 1px solid var(--bg-light);
}

.delivery-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.delivery-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 10px;
    flex-shrink: 0;
}

.delivery-icon svg {
    color: var(--success);
}

.delivery-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.delivery-subtitle {
    font-size: 13px;
    color: var(--text-light);
}

/* Specifications Section */
.specs-section {
    background: white;
    padding: 60px 0;
    margin-top: 40px;
    border-radius: 18px;
}

.specs-section .section-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 32px;
    text-align: center;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
}

.spec-category {
    padding: 24px;
    background: var(--bg-light);
    border-radius: 16px;
}

.spec-category-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.spec-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.spec-name {
    font-size: 14px;
    color: var(--text-light);
    flex-shrink: 0;
}

.spec-item .spec-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
    text-align: right;
}

/* Rate Period Buttons (Modal) */
.rate-period-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

.rate-period-btn:hover {
    border-color: var(--border);
}

.rate-period-btn.active {
    border-color: var(--primary);
    background: rgba(0, 113, 227, 0.05);
}

.rate-percent {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}

.rate-months {
    font-size: 12px;
    color: var(--text-light);
}

/* Fullscreen Gallery */
#fullscreenGallery,
.fullscreen-gallery {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#fullscreenGallery.show,
.fullscreen-gallery.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto;
}

.fullscreen-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.fullscreen-gallery .gallery-nav {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.fullscreen-gallery .gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.fullscreen-gallery .gallery-close,
.gallery-close {
    position: absolute !important;
    top: 20px !important;
    right: 30px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    border: none !important;
    color: white !important;
    font-size: 24px;
    cursor: pointer;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transition: background 0.2s;
    z-index: 10000;
}

.fullscreen-gallery .gallery-close:hover,
.gallery-close:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
}

/* Product Detail Responsive */
@media (max-width: 991.98px) {
    .product-gallery-container {
        margin-bottom: 24px;
    }

    .product-detail-title {
        font-size: 24px;
    }

    .product-price-section .price-current {
        font-size: 28px;
    }

    .specs-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .product-gallery-container,
    .product-info-container {
        padding: 20px;
        border-radius: 12px;
    }

    .product-detail-title {
        font-size: 22px;
    }

    .product-detail-actions {
        flex-wrap: wrap;
    }

    .product-detail-actions .btn-add-cart {
        width: 100%;
        flex: 0 0 100%;
    }

    .btn-icon-action {
        flex: 1;
    }

    .gallery-nav {
        width: 36px;
        height: 36px;
    }

    .gallery-prev {
        left: 8px;
    }

    .gallery-next {
        right: 8px;
    }

    .storage-options {
        flex-direction: column;
    }

    .storage-option {
        min-width: 100%;
    }

    .specs-section {
        padding: 40px 20px;
        margin-top: 24px;
    }

    .specs-section .section-title {
        font-size: 24px;
        margin-bottom: 24px;
    }

    .spec-category {
        padding: 20px;
    }
}

/* Action feedback notification */
.action-feedback {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
