/* ============================================
   KRDDO FASHION - PRODUCT DETAIL PAGE
   Version: 2.0 (Modern)
   Uses CSS variables from style-prefix.css
   ============================================ */

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb-container {
    background: #f8f8f8;
    padding: 12px 0;
    border-bottom: 1px solid var(--pale-purple-pentone);
    margin-bottom: 30px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-7);
    color: var(--coolers-black);
}

.breadcrumb a {
    color: var(--coolers-black);
    text-decoration: none;
    transition: color var(--transition-normal);
}

.breadcrumb a:hover {
    color: var(--main-maroon);
}

.breadcrumb .separator {
    color: var(--spanish-gray);
    font-size: var(--fs-8);
}

.breadcrumb .current {
    color: var(--main-maroon);
    font-weight: var(--weight-500);
}

/* ============================================
   PRODUCT DETAIL SECTION
   ============================================ */
.product-detail-section {
    padding: 0 0 50px;
}

.product-detail-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 30px;
    border: 1px solid var(--pale-purple-pentone);
}

/* ============================================
   PRODUCT GALLERY
   ============================================ */
.product-gallery {
    position: sticky;
    top: 30px;
    align-self: start;
}

.product-main-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8f9fa;
    border-radius: var(--border-radius-md);
    overflow: hidden;
    border: 1px solid var(--pale-purple-pentone);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
    transition: transform var(--transition-slow);
}

.main-image:hover {
    transform: scale(1.05);
}

/* Badges on Image */
.discount-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #dc3545;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: var(--fs-8);
    font-weight: var(--weight-700);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    z-index: 2;
}

.stock-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: var(--fs-8);
    font-weight: var(--weight-600);
    z-index: 2;
}

.stock-badge.out-of-stock {
    background: #dc3545;
    color: white;
}

.stock-badge.low-stock {
    background: #ffc107;
    color: #333;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Thumbnails */
.product-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.thumbnail {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border: 2px solid var(--pale-purple-pentone);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    padding: 5px;
    background: white;
    transition: all var(--transition-normal);
    opacity: 0.6;
}

.thumbnail:hover {
    opacity: 0.8;
    border-color: var(--spanish-gray);
}

.thumbnail.active {
    opacity: 1;
    border-color: var(--main-maroon);
    box-shadow: 0 0 0 3px rgba(206, 89, 89, 0.15);
}

/* ============================================
   PRODUCT INFO
   ============================================ */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.product-title {
    font-size: var(--fs-1);
    font-weight: var(--weight-700);
    color: var(--eerie-black);
    line-height: 1.3;
    margin: 0;
}

/* Rating */
.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-rating .stars {
    display: flex;
    gap: 2px;
    color: var(--sandy-brown);
    font-size: 18px;
}

.product-rating .rating-text {
    font-size: var(--fs-7);
    color: var(--coolers-black);
}

/* Pricing */
.product-pricing {
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--pale-purple-pentone);
}

.price-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 5px;
}

.price-box .price {
    font-size: 28px;
    font-weight: var(--weight-800);
    color: var(--main-maroon);
}

.price-box del {
    font-size: var(--fs-4);
    color: var(--spanish-gray);
}

.discount-label {
    display: inline-block;
    background: #d4edda;
    color: #155724;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--fs-8);
    font-weight: var(--weight-500);
}

/* Description */
.product-description {
    padding: 0;
}

.product-description h3 {
    font-size: var(--fs-5);
    font-weight: var(--weight-600);
    color: var(--eerie-black);
    margin-bottom: 10px;
}

.product-description p {
    font-size: var(--fs-7);
    color: var(--coolers-black);
    line-height: 1.8;
    margin: 0;
}

/* Product Options (Color, Size) */
.product-option {
    margin-bottom: 5px;
}

.product-option label {
    display: block;
    font-size: var(--fs-7);
    font-weight: var(--weight-600);
    color: var(--eerie-black);
    margin-bottom: 8px;
}

.product-option .required {
    color: #dc3545;
}

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

.color-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border: 2px solid var(--pale-purple-pentone);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-normal);
}

.color-option:hover {
    border-color: var(--spanish-gray);
}

.color-option input[type="radio"] {
    display: none;
}

.color-option input[type="radio"]:checked + .color-swatch {
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--main-maroon);
}

.color-option input[type="radio"]:checked ~ .color-name {
    color: var(--main-maroon);
    font-weight: var(--weight-600);
}

.color-option input[type="radio"]:checked + .color-swatch + .color-name {
    color: var(--main-maroon);
    font-weight: var(--weight-600);
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ddd;
    display: inline-block;
}

.color-name {
    font-size: var(--fs-8);
    color: var(--coolers-black);
}

/* Size Options */
.size-options select {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 2px solid var(--pale-purple-pentone);
    border-radius: var(--border-radius-sm);
    font-size: var(--fs-7);
    color: var(--eerie-black);
    background: white;
    cursor: pointer;
    transition: border-color var(--transition-normal);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.size-options select:focus {
    outline: none;
    border-color: var(--main-maroon);
    box-shadow: 0 0 0 3px rgba(206, 89, 89, 0.1);
}

.size-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fs-8);
    color: var(--main-maroon);
    text-decoration: none;
    margin-top: 8px;
    transition: color var(--transition-normal);
}

.size-guide-link:hover {
    color: var(--deep-maroon);
    text-decoration: underline;
}

/* ============================================
   PRODUCT ACTIONS
   ============================================ */
.product-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid var(--pale-purple-pentone);
    border-bottom: 1px solid var(--pale-purple-pentone);
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 2px solid var(--pale-purple-pentone);
    border-radius: var(--border-radius-sm);
    width: fit-content;
    overflow: hidden;
}

.qty-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--eerie-black);
    transition: all var(--transition-normal);
}

.qty-btn:hover {
    background: var(--main-maroon);
    color: white;
}

.quantity-input {
    width: 60px;
    height: 44px;
    text-align: center;
    border: none;
    border-left: 2px solid var(--pale-purple-pentone);
    border-right: 2px solid var(--pale-purple-pentone);
    font-size: var(--fs-5);
    font-weight: var(--weight-600);
    color: var(--eerie-black);
    background: white;
}

.quantity-input:focus {
    outline: none;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-add-to-cart,
.btn-buy-now {
    flex: 1;
    min-width: 180px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: var(--fs-7);
    font-weight: var(--weight-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

.btn-add-to-cart {
    background: var(--main-maroon);
    color: white;
}

.btn-add-to-cart:hover:not(:disabled) {
    background: var(--deep-maroon);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

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

.btn-buy-now {
    background: var(--eerie-black);
    color: white;
}

.btn-buy-now:hover:not(:disabled) {
    background: #333;
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

.btn-buy-now:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Wishlist Button */
.btn-wishlist {
    padding: 12px 20px;
    border: 2px solid var(--pale-purple-pentone);
    border-radius: var(--border-radius-md);
    background: transparent;
    color: var(--coolers-black);
    cursor: pointer;
    font-size: var(--fs-7);
    font-weight: var(--weight-500);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
    width: 100%;
}

.btn-wishlist:hover {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
}

.btn-wishlist.active {
    border-color: #dc3545;
    color: #dc3545;
    background: #fff5f5;
}

/* ============================================
   PRODUCT META
   ============================================ */
.product-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--fs-7);
    color: var(--coolers-black);
}

.meta-item ion-icon {
    font-size: 20px;
    color: var(--main-maroon);
    flex-shrink: 0;
}

.meta-item.in-stock ion-icon {
    color: var(--success-green);
}

.meta-item .in-stock {
    color: var(--success-green);
    font-weight: var(--weight-500);
}

.meta-item .out-of-stock {
    color: var(--danger-red);
    font-weight: var(--weight-500);
}

/* ============================================
   PRODUCT SHARE
   ============================================ */
.product-share {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 10px;
}

.product-share span {
    font-size: var(--fs-7);
    font-weight: var(--weight-500);
    color: var(--eerie-black);
}

.product-share a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    font-size: 18px;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.product-share a:hover {
    background: var(--main-maroon);
    color: white;
    transform: translateY(-2px);
}

/* ============================================
   RELATED PRODUCTS
   ============================================ */
.related-products {
    margin-bottom: 50px;
}

.section-title {
    font-size: var(--fs-2);
    font-weight: var(--weight-700);
    color: var(--eerie-black);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--main-maroon);
    border-radius: 2px;
}

.related-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.related-product-card {
    border: 1px solid var(--pale-purple-pentone);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    background: var(--white);
}

.related-product-card:hover {
    box-shadow: var(--box-shadow-md);
    transform: translateY(-5px);
}

.related-product-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-product-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    padding: 15px;
    background: #f8f9fa;
    transition: transform var(--transition-normal);
}

.related-product-card:hover img {
    transform: scale(1.05);
}

.related-product-card h4 {
    padding: 10px 15px 5px;
    font-size: var(--fs-7);
    font-weight: var(--weight-500);
    color: var(--eerie-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-product-card .price {
    padding: 0 15px 15px;
    font-size: var(--fs-7);
    font-weight: var(--weight-700);
    color: var(--main-maroon);
}

.related-product-card .price del {
    font-weight: var(--weight-400);
    color: var(--spanish-gray);
    font-size: var(--fs-8);
    margin-left: 8px;
}

/* ============================================
   PRODUCT REVIEWS
   ============================================ */
.product-reviews {
    margin-bottom: 50px;
}

.reviews-summary {
    background: #f8f9fa;
    padding: 25px 30px;
    border-radius: var(--border-radius-md);
    margin-bottom: 30px;
    border: 1px solid var(--pale-purple-pentone);
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.rating-number {
    font-size: 42px;
    font-weight: var(--weight-800);
    color: var(--eerie-black);
    line-height: 1;
}

.average-rating .stars {
    display: flex;
    gap: 3px;
    color: var(--sandy-brown);
    font-size: 22px;
}

.review-count {
    font-size: var(--fs-7);
    color: var(--coolers-black);
    width: 100%;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-item {
    padding: 20px;
    border: 1px solid var(--pale-purple-pentone);
    border-radius: var(--border-radius-md);
    background: var(--white);
    transition: all var(--transition-normal);
}

.review-item:hover {
    box-shadow: var(--box-shadow-sm);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.review-header strong {
    font-size: var(--fs-6);
    color: var(--eerie-black);
}

.review-rating {
    display: flex;
    gap: 2px;
    color: var(--sandy-brown);
    font-size: 16px;
}

.review-date {
    font-size: var(--fs-8);
    color: var(--spanish-gray);
    margin-left: auto;
}

.review-text {
    font-size: var(--fs-7);
    color: var(--coolers-black);
    line-height: 1.8;
    margin: 0;
}

.no-reviews {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--pale-purple-pentone);
}

.no-reviews p {
    font-size: var(--fs-6);
    color: var(--coolers-black);
    margin-bottom: 20px;
}

.no-reviews .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: var(--main-maroon);
    color: white;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: var(--fs-7);
    font-weight: var(--weight-600);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.no-reviews .btn-primary:hover {
    background: var(--deep-maroon);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-md);
}

/* ============================================
   RESPONSIVE - TABLET (768-1024px)
   ============================================ */
@media (max-width: 1024px) {
    .product-detail-wrapper {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px;
    }

    .product-gallery {
        position: static;
    }

    .related-products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .price-box .price {
        font-size: 24px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE LANDSCAPE (480-768px)
   ============================================ */
@media (max-width: 768px) {
    .breadcrumb-container {
        padding: 10px 0;
        margin-bottom: 20px;
    }

    .breadcrumb {
        font-size: var(--fs-8);
    }

    .product-detail-wrapper {
        padding: 15px;
        gap: 25px;
        border-radius: var(--border-radius-md);
    }

    .product-main-image {
        aspect-ratio: 4 / 3;
    }

    .main-image {
        padding: 15px;
    }

    .product-title {
        font-size: var(--fs-2);
    }

    .product-pricing {
        padding: 15px;
    }

    .price-box .price {
        font-size: 22px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-add-to-cart,
    .btn-buy-now {
        min-width: 100%;
        padding: 12px 20px;
    }

    .related-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .rating-number {
        font-size: 32px;
    }

    .reviews-summary {
        padding: 20px;
    }

    .review-header {
        gap: 10px;
    }

    .review-date {
        margin-left: 0;
        width: 100%;
    }

    .thumbnail {
        width: 60px;
        height: 60px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE PORTRAIT (0-480px)
   ============================================ */
@media (max-width: 480px) {
    .breadcrumb-container {
        padding: 8px 0;
        margin-bottom: 15px;
    }

    .product-detail-wrapper {
        padding: 10px;
        gap: 20px;
    }

    .product-main-image {
        aspect-ratio: 1 / 1;
    }

    .main-image {
        padding: 10px;
    }

    .product-title {
        font-size: var(--fs-3);
    }

    .product-rating .stars {
        font-size: 16px;
    }

    .product-pricing {
        padding: 12px;
    }

    .price-box .price {
        font-size: 20px;
    }

    .price-box del {
        font-size: var(--fs-6);
    }

    .product-actions {
        padding: 15px 0;
    }

    .quantity-selector {
        width: 100%;
    }

    .qty-btn {
        width: 48px;
        height: 44px;
    }

    .quantity-input {
        flex: 1;
    }

    .btn-add-to-cart,
    .btn-buy-now {
        font-size: var(--fs-8);
        padding: 12px 16px;
    }

    .related-products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .related-product-card h4 {
        font-size: var(--fs-8);
        padding: 8px 10px 4px;
    }

    .related-product-card .price {
        font-size: var(--fs-8);
        padding: 0 10px 10px;
    }

    .section-title {
        font-size: var(--fs-3);
    }

    .rating-number {
        font-size: 28px;
    }

    .average-rating .stars {
        font-size: 18px;
    }

    .review-item {
        padding: 15px;
    }

    .thumbnail {
        width: 50px;
        height: 50px;
    }

    .product-share a {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .discount-badge,
    .stock-badge {
        padding: 4px 10px;
        font-size: var(--fs-9);
    }
}
