/* =============================================
   product-details.css - Complete Styling
   ============================================= */

/* ========== BASE & RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.product-details {
    padding: 20px 0;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb span {
    margin: 0 8px;
    color: #999;
}

/* ========== MAIN PRODUCT CONTAINER ========== */
.product-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

@media (min-width: 769px) {
    .product-container {
        display: flex;
        gap: 40px;
    }
    .product-images {
        flex: 1;
        min-width: 0;
    }
    .product-info {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .product-container {
        padding: 15px;
    }
}

/* ========== PRODUCT IMAGES ========== */
.product-images {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.main-image-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    margin-bottom: 15px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s;
}

.main-image:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .main-image {
        max-height: 300px;
    }
}

/* Navigation Arrows */
.swipe-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.swipe-nav button {
    width: 35px;
    height: 35px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s;
}

@media (max-width: 768px) {
    .swipe-nav button {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Thumbnails - Horizontal Scroll */
.image-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.image-thumbnails::-webkit-scrollbar {
    height: 5px;
}

.image-thumbnails::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.image-thumbnails::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.thumbnail {
    width: 70px;
    height: 70px;
    min-width: 70px;
    min-height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: #667eea;
}

@media (max-width: 768px) {
    .thumbnail {
        width: 60px;
        height: 60px;
        min-width: 60px;
        min-height: 60px;
    }
}

/* Swipe Indicators */
.swipe-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}

.swipe-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
}

.swipe-dot.active {
    background: #667eea;
    width: 20px;
    border-radius: 4px;
}

/* Badges */
.discount-badge-large {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

.cashback-badge-large {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 10;
}

/* ========== PRODUCT INFO ========== */
.product-info {
    display: flex;
    flex-direction: column;
}

.product-info h1 {
    font-size: 22px;
    color: #333;
    margin-bottom: 15px;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .product-info h1 {
        font-size: 20px;
    }
}

.product-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.product-category {
    background: #e8eaf6;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #667eea;
}

.product-stock {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.stock-in {
    background: #d4edda;
    color: #155724;
}

.stock-low {
    background: #fff3cd;
    color: #856404;
}

.stock-out {
    background: #f8d7da;
    color: #721c24;
}

/* Price */
.product-price {
    margin-bottom: 20px;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-right: 10px;
}

.current-price {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
}

.discount-badge {
    background: #dc3545;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    margin-left: 10px;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.quantity-selector span {
    font-weight: 500;
    color: #555;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    background: #f8f9fa;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.quantity-input {
    width: 50px;
    height: 35px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

/* Action Buttons - Desktop (Row layout) */
.product-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.add-to-cart-btn,
.buy-now-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn {
    background: #667eea;
    color: white;
}

.add-to-cart-btn:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
}

.buy-now-btn {
    background: #28a745;
    color: white;
}

.buy-now-btn:hover:not(:disabled) {
    background: #218838;
    transform: translateY(-2px);
}

.wishlist-btn {
    width: 45px;
    height: 45px;
    background: white;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    color: #dc3545;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-btn:hover {
    background: #dc3545;
    border-color: #dc3545;
    color: white;
}

/* Delivery Checker */
.delivery-checker {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.delivery-checker h4 {
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
}

.delivery-input-group {
    display: flex;
    gap: 10px;
}

.delivery-input-group input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.delivery-input-group button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .delivery-input-group {
        flex-direction: column;
    }
    .delivery-input-group button {
        width: 100%;
    }
}

/* Product Features */
.product-features {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

.feature-item i {
    color: #667eea;
}

/* ========== INFO SECTIONS ========== */
.basic-info-section,
.product-specs-section,
.product-description-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.basic-info-section h3,
.product-specs-section h3,
.product-description-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    border-left: 3px solid #667eea;
    padding-left: 12px;
}

.description-content {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
}

/* Basic Info Grid */
.basic-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    width: 130px;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.info-label i {
    width: 20px;
    color: #667eea;
    margin-right: 5px;
}

.info-value {
    flex: 1;
    color: #333;
    font-size: 13px;
    word-break: break-word;
}

@media (max-width: 768px) {
    .info-row {
        flex-direction: column;
        padding: 10px 0;
    }
    .info-label {
        width: 100%;
        margin-bottom: 5px;
    }
    .info-value {
        padding-left: 25px;
    }
}

/* Specifications */
.specs-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.spec-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
}

.spec-key {
    font-weight: 700;
    color: #667eea;
    font-size: 13px;
    margin-bottom: 5px;
}

.spec-value {
    font-size: 13px;
    color: #555;
    padding-left: 20px;
}

/* ========== SIMILAR & MORE PRODUCTS ========== */
.similar-products-section,
.more-products-section {
    margin-top: 30px;
}

.similar-products-header,
.more-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.similar-products-header h3,
.more-products-header h3 {
    font-size: 20px;
    margin: 0;
    color: #333;
    border-left: 4px solid #667eea;
    padding-left: 12px;
}

/* Horizontal Scroll Container */
.products-scroll-row {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.products-scroll-row::-webkit-scrollbar {
    height: 4px;
}

.products-scroll-row::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.products-scroll-row::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

.products-scroll-inner {
    display: flex;
    gap: 16px;
    width: max-content;
    min-width: 100%;
}

/* Product Cards inside Horizontal Scroll */
.products-scroll-inner .product-card {
    width: 200px;
    flex-shrink: 0;
}

/* Load More Button */
.load-more-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

/* No Products Message */
.no-products-message {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    color: #666;
}

/* ========== REVIEWS SECTION ========== */
.reviews-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px 20px;
    margin: 30px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.reviews-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.reviews-title-row {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.reviews-title-row h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
    border-left: 4px solid #667eea;
    padding-left: 12px;
}

.overall-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9ff;
    border-radius: 10px;
    padding: 8px 14px;
}

.big-score {
    font-size: 32px;
    font-weight: 800;
    color: #667eea;
    line-height: 1;
}

.rating-right {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.stars-row {
    color: #f5a623;
    font-size: 14px;
}

.write-review-btn,
.login-to-review {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.already-reviewed-badge {
    background: #e6f9ee;
    color: #28a745;
    padding: 8px 14px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Review Form */
.review-form-wrapper {
    background: #f8f9ff;
    border: 1.5px solid #e0e4ff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.req {
    color: #dc3545;
}

.star-picker {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 28px;
    cursor: pointer;
}

.star-picker i {
    color: #ddd;
}

.star-picker i.active {
    color: #f5a623;
}

textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    min-height: 90px;
    font-family: inherit;
}

textarea:focus {
    border-color: #667eea;
    outline: none;
}

.photo-upload-area {
    border: 2px dashed #c0c8ff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: #fafbff;
}

.photo-upload-icon {
    font-size: 32px;
    color: #c0c8ff;
    margin-bottom: 6px;
}

.remove-photo-btn {
    margin-top: 8px;
    background: #fff0f0;
    color: #dc3545;
    border: 1px solid #f5c6cb;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.submit-review-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cancel-review-btn {
    background: #f0f0f0;
    color: #555;
    border: none;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
}

/* Review Items */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.no-reviews {
    text-align: center;
    padding: 30px 0;
    color: #aaa;
}

.review-item {
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    background: #fafafa;
}

.review-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.reviewer-info strong {
    font-size: 14px;
    color: #333;
    display: block;
}

.review-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 13px;
    color: #f5a623;
    flex-wrap: wrap;
}

.review-date {
    font-size: 12px;
    color: #999;
    margin-left: 6px;
}

.review-text {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 10px;
}

.review-photo img {
    max-width: 160px;
    max-height: 160px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #e0e0e0;
}

/* Photo Modal */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.photo-modal img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 26px;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
}

/* Alert Box */
.alert-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-box.success {
    background: #e6f9ee;
    color: #1a7f43;
    border: 1px solid #b7ebc8;
}

.alert-box.error {
    background: #fff0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

/* ========== ALERTS ========== */
.alert {
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 13px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
}

/* ========== RESPONSIVE ========== */

/* Tablet */
@media (max-width: 768px) {
    .quantity-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .quantity-controls {
        width: 100%;
    }
    .quantity-btn {
        flex: 1;
        height: 48px;
    }
    .quantity-input {
        flex: 2;
        height: 48px;
    }
    
    /* ✅ FIX: Buttons on same row for mobile (product details page) */
    .product-actions {
        display: flex;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .add-to-cart-btn,
    .buy-now-btn {
        flex: 1;
        min-width: calc(33% - 6px);
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .wishlist-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }
    
    /* Reviews section spacing */
    .reviews-section {
        margin: 20px 0;
    }
    
    /* Similar & More products spacing */
    .similar-products-section,
    .more-products-section {
        margin-top: 20px;
    }
}

/* Mobile Small (under 480px) - Buttons same row with smaller padding */
@media (max-width: 480px) {
    .reviews-header {
        flex-direction: column;
    }
    .big-score {
        font-size: 26px;
    }
    .star-picker {
        font-size: 24px;
    }
    .review-photo img {
        max-width: 120px;
        max-height: 120px;
    }
    .thumbnail {
        width: 50px;
        height: 50px;
        min-width: 50px;
        min-height: 50px;
    }
    
    /* ✅ FIX: Buttons same row on small mobile - adjust padding */
    .product-actions {
        display: flex;
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .add-to-cart-btn,
    .buy-now-btn {
        flex: 1;
        min-width: calc(33% - 4px);
        padding: 8px 8px;
        font-size: 10px;
    }
    
    .add-to-cart-btn i,
    .buy-now-btn i {
        font-size: 10px;
    }
    
    .wishlist-btn {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 14px;
    }
}