/**
 * Item Page Styles
 * TOS Webcommerce - Product Detail Page
 */

/* ===== Base Styles ===== */
[x-cloak] {
    display: none !important;
}

.item-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.item-page a {
    text-decoration: none !important;
}

/* Preserve FontAwesome icons */
.item-page .fa,
.item-page [class^="fa-"],
.item-page [class*=" fa-"] {
    font-family: 'FontAwesome' !important;
}

/* ===== Primary Color Variables ===== */
.text-primary {
    color: var(--primary-color, #3b82f6) !important;
}

.bg-primary {
    background-color: var(--primary-color, #3b82f6) !important;
}

.border-primary {
    border-color: var(--primary-color, #3b82f6) !important;
}

.hover\:text-primary:hover {
    color: var(--primary-color, #3b82f6) !important;
}

.hover\:bg-primary:hover {
    background-color: var(--primary-color, #3b82f6) !important;
}

.hover\:border-primary:hover {
    border-color: var(--primary-color, #3b82f6) !important;
}

/* ===== Breadcrumbs ===== */
.item-breadcrumbs-wrapper {
    border-bottom: 1px solid #e5e7eb;
}

.item-breadcrumbs-wrapper a:hover {
    color: var(--primary-color, #3b82f6);
}

/* ===== Product Image Section ===== */
.item-image-section {
    position: sticky;
    top: 100px;
}

@media (max-width: 767px) {
    .item-image-section {
        position: static;
    }
}

/* ===== Variant Chips ===== */
.variant-chip {
    min-width: 48px;
    text-align: center;
    user-select: none;
}

.variant-chip-selected {
    background-color: var(--primary-color, #3b82f6) !important;
    border-color: var(--primary-color, #3b82f6) !important;
    color: white !important;
}

.variant-chip-default:hover:not(:disabled) {
    border-color: var(--primary-color, #3b82f6) !important;
}

.variant-chip-disabled {
    opacity: 0.5;
}

/* ===== Quantity Selector ===== */
.quantity-selector {
    display: inline-flex;
}

.quantity-selector input[type="number"]::-webkit-inner-spin-button,
.quantity-selector input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-selector input[type="number"] {
    -moz-appearance: textfield;
}

/* ===== Add to Cart Button ===== */
.btn-add-to-cart {
    background-color: var(--primary-color, #3b82f6);
    border: none;
}

.btn-add-to-cart:hover:not(:disabled) {
    filter: brightness(0.9);
}

.btn-add-to-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Wishlist Button ===== */
.wishlist-btn:hover {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.wishlist-btn-header:hover i {
    transform: scale(1.1);
    transition: transform 0.2s;
}

/* ===== Quick Info Cards ===== */
.quick-info-card {
    transition: all 0.2s ease;
}

.quick-info-card:hover {
    border-color: var(--primary-color, #3b82f6);
    background-color: #f8fafc;
}

.quick-info-card:hover i {
    color: var(--primary-color, #3b82f6);
}

/* ===== Product Sections ===== */
.prose {
    color: #374151;
}

.prose p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.prose ul,
.prose ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose h3,
.prose h4 {
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: #1f2937;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.prose th,
.prose td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* ===== Specifications Table ===== */
.specifications-table {
    width: 100%;
}

.specifications-table tr:nth-child(even) {
    background-color: #f9fafb;
}

.specifications-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.specifications-table td:first-child {
    font-weight: 500;
    color: #6b7280;
    width: 35%;
}

.specifications-table td:last-child {
    color: #1f2937;
}

/* ===== Reviews Section ===== */
.review-card {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.review-card:last-child {
    border-bottom: none;
}

.review-rating .fa-star {
    color: #f59e0b;
}

.review-rating .fa-star-o {
    color: #d1d5db;
}

/* ===== Recommended Items ===== */
.recommended-item {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.recommended-item:hover {
    background-color: #f9fafb;
}

.recommended-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

/* ===== Glide.js Overrides ===== */
.glide__bullets {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
}

.glide__bullet {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background: #d1d5db;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.glide__bullet:hover {
    background: #9ca3af;
}

.glide__bullet--active {
    background: var(--primary-color, #3b82f6);
    width: 24px;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s ease forwards;
}

/* ===== Responsive Styles ===== */
@media (max-width: 575px) {
    .item-breadcrumbs-wrapper {
        padding: 0.5rem 0;
    }

    .item-details-section {
        padding-top: 1rem;
    }

    .variant-chip {
        padding: 0.5rem 0.75rem;
        font-size: 13px;
    }

    .quantity-selector button {
        padding: 0.5rem 0.75rem;
    }

    .quantity-selector input {
        width: 48px;
    }

    .btn-add-to-cart {
        padding: 0.75rem 1rem;
        font-size: 14px;
    }

    .quick-info-card {
        padding: 0.5rem;
    }

    .quick-info-card i {
        font-size: 1rem;
    }

    .quick-info-card div {
        font-size: 11px;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .variant-chip {
        padding: 0.5rem 1rem;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .item-image-section {
        max-width: 400px;
    }
}

@media (min-width: 992px) {
    .item-image-section {
        position: sticky;
        top: 100px;
    }
}

/* ===== Print Styles ===== */
@media print {
    .item-page {
        background: white;
    }

    .wishlist-btn,
    .btn-add-to-cart,
    .quantity-selector,
    .glide__arrows,
    .glide__bullets {
        display: none !important;
    }
}
