/**
 * Product Details Modal & Page - High Conversion E-Commerce Layout
 * Optimized for PC Desktop (2-Column Hero Grid) & Smartphone (1-Column Responsive)
 * ElectWatch Professional Theme
 */

:root {
    --ew-bg: #ffffff;
    --ew-surface: #f8fafc;
    --ew-surface-hover: #f1f5f9;
    --ew-primary: #f68b1e; /* High conversion orange */
    --ew-primary-hover: #e07e1b;
    --ew-primary-gradient: linear-gradient(135deg, #ff9f43 0%, #f68b1e 100%);
    --ew-cta-green: #10b981; /* Instant checkout green */
    --ew-cta-green-hover: #059669;
    --ew-whatsapp: #25d366;
    --ew-text-dark: #0f172a;
    --ew-text-muted: #64748b;
    --ew-text-light: #94a3b8;
    --ew-border: #e2e8f0;
    --ew-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --ew-shadow-md: 0 4px 14px rgba(0,0,0,0.08);
    --ew-shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    --ew-radius: 12px;
}

/* ========================================
   MODAL CONTAINER & OVERLAY
   ======================================== */

.ew-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100000;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--ew-text-dark);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
}

.ew-details-modal.active {
    opacity: 1;
}

.ew-details-container {
    width: 100%;
    max-width: 1140px;
    background: var(--ew-bg);
    border-radius: 20px;
    box-shadow: var(--ew-shadow-lg);
    position: relative;
    padding: 32px;
    margin: 20px auto 40px auto;
    box-sizing: border-box;
    animation: ewSlideUp 0.35s ease-out;
}

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

/* Back / Close Button */
.ew-back-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    background: var(--ew-surface);
    border: 1px solid var(--ew-border);
    border-radius: 50%;
    color: var(--ew-text-dark);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 105;
    transition: all 0.2s ease;
    box-shadow: var(--ew-shadow-sm);
}

.ew-back-btn:hover {
    background: #fee2e2;
    color: #ef4444;
    border-color: #fca5a5;
    transform: rotate(90deg);
}

/* ========================================
   ABOVE THE FOLD - GRID (PC & MOBILE)
   ======================================== */

.ew-product-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 30px;
}

/* ========================================
   LEFT COLUMN - GALLERY VISUELLE
   ======================================== */

.ew-gallery-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ew-main-display {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--ew-surface);
    border: 1px solid var(--ew-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.ew-main-img-zoom {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.06));
}

.ew-main-display:hover .ew-main-img-zoom {
    transform: scale(1.05);
}

.ew-gallery-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

.ew-thumbnails-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.ew-thumb-item {
    flex: 0 0 76px;
    height: 76px;
    border-radius: 12px;
    border: 2px solid var(--ew-border);
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
    padding: 4px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.ew-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ew-thumb-item:hover {
    border-color: var(--ew-primary-hover);
}

.ew-thumb-item.active {
    border-color: var(--ew-primary);
    box-shadow: 0 0 0 3px rgba(246, 139, 30, 0.2);
}

/* ========================================
   RIGHT COLUMN - KEY INFO & CTA
   ======================================== */

.ew-info-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ew-category-badge-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ew-badge-pill {
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.ew-stock-status-pill {
    font-size: 12px;
    font-weight: 800;
    padding: 5px 14px;
    border-radius: 20px;
}

.ew-stock-status-pill.in-stock {
    background: #ecfdf5;
    color: #047857;
}

.ew-stock-status-pill.out-of-stock {
    background: #fef2f2;
    color: #b91c1c;
}

.ew-product-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--ew-text-dark);
    margin: 0;
    line-height: 1.35;
}

/* Ratings */
.ew-ratings-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff7ed;
    border: 1px solid #ffedd5;
    padding: 6px 14px;
    border-radius: 8px;
    width: fit-content;
}

.ew-stars {
    color: #f59e0b;
    font-size: 16px;
    letter-spacing: 2px;
}

.ew-rating-score {
    font-weight: 800;
    color: var(--ew-text-dark);
    font-size: 14px;
}

.ew-rating-count {
    color: var(--ew-text-muted);
    font-size: 13px;
}

/* Price Box */
.ew-price-box {
    display: flex;
    align-items: baseline;
    gap: 16px;
    background: var(--ew-surface);
    border: 1px solid var(--ew-border);
    padding: 16px 20px;
    border-radius: 14px;
    flex-wrap: wrap;
}

.ew-price-main {
    font-size: 34px;
    font-weight: 900;
    color: var(--ew-primary);
    letter-spacing: -0.5px;
}

.ew-old-price-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.ew-discount-badge {
    background: #ef4444;
    color: #ffffff;
    font-weight: 800;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

/* Urgency Bar */
.ew-urgency-bar-container {
    background: #fff1f2;
    border: 1px solid #ffe4e6;
    border-radius: 12px;
    padding: 12px 16px;
}

.ew-urgency-header {
    font-size: 13px;
    color: #be123c;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ew-progress-bar {
    width: 100%;
    height: 8px;
    background: #fecdd3;
    border-radius: 10px;
    overflow: hidden;
}

.ew-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f43f5e 0%, #e11d48 100%);
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* CTA Group */
.ew-cta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

.ew-btn-primary-cta {
    width: 100%;
    padding: 16px 24px;
    background: var(--ew-primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(246, 139, 30, 0.35);
    transition: all 0.25s ease;
}

.ew-btn-primary-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(246, 139, 30, 0.45);
}

.ew-btn-primary-cta:active {
    transform: scale(0.98);
}

.ew-cta-title {
    font-size: 18px;
    letter-spacing: 0.5px;
}

.ew-cta-sub {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.95;
}

.ew-cta-secondary-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.ew-btn-secondary-cart {
    padding: 14px 20px;
    background: var(--ew-surface);
    color: var(--ew-text-dark);
    border: 1px solid var(--ew-border);
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.ew-btn-secondary-cart:hover {
    background: var(--ew-surface-hover);
    border-color: #cbd5e1;
}

.ew-btn-whatsapp-cta {
    padding: 14px 20px;
    background: var(--ew-whatsapp);
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.25);
}

.ew-btn-whatsapp-cta:hover {
    background: #128c7e;
    color: #ffffff;
}

/* Reassurance Badges Grid */
.ew-reassurance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.ew-reassurance-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--ew-surface);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--ew-border);
}

.ew-reassurance-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.ew-reassurance-text strong {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ew-text-dark);
}

.ew-reassurance-text span {
    display: block;
    font-size: 11px;
    color: var(--ew-text-muted);
}

/* ========================================
   TABS SECTION & CONTENTS
   ======================================== */

.ew-tabs-container {
    margin-top: 40px;
    border-top: 1px solid var(--ew-border);
    padding-top: 32px;
}

.ew-tabs-header {
    display: flex;
    gap: 12px;
    border-bottom: 2px solid var(--ew-border);
    margin-bottom: 28px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.ew-tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    font-weight: 700;
    font-size: 15px;
    color: var(--ew-text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -4px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.ew-tab-btn:hover {
    color: var(--ew-primary-hover);
}

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

.ew-tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ew-tab-content.active {
    display: block;
    opacity: 1;
}

/* Benefits Box */
.ew-benefits-box {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
}

.ew-benefits-box h3 {
    color: #166534;
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 16px 0;
    border: none !important;
    padding: 0 !important;
}

.ew-benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.ew-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: #15803d;
    font-weight: 600;
    line-height: 1.4;
}

.ew-benefit-check {
    background: #22c55e;
    color: #ffffff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Description Text Box */
.ew-description-text-box h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--ew-text-dark);
    margin: 0 0 14px 0;
    border: none !important;
    padding: 0 !important;
}

.ew-description-text {
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
    background: var(--ew-surface);
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--ew-border);
}

.ew-description-text p {
    margin-bottom: 12px;
}

.ew-description-text ul, .ew-description-text ol {
    margin-left: 20px;
    margin-bottom: 14px;
}

/* Pack Items Grid */
.ew-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ew-item-card {
    background: #ffffff;
    border: 1px solid var(--ew-border);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    transition: all 0.25s ease;
}

.ew-item-card:hover {
    border-color: var(--ew-primary);
    transform: translateY(-3px);
    box-shadow: var(--ew-shadow-md);
}

.ew-item-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 auto 12px;
    display: block;
}

.ew-item-placeholder {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ew-surface);
    border-radius: 50%;
    font-size: 28px;
}

.ew-item-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ew-text-dark);
    line-height: 1.3;
}

.ew-item-quantity {
    font-size: 12px;
    color: var(--ew-primary);
    font-weight: 800;
    margin-top: 4px;
    display: block;
}

/* Technical Specs Table */
.ew-specs-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--ew-border);
}

.ew-specs-table th {
    background: var(--ew-surface);
    padding: 14px 20px;
    font-weight: 800;
    font-size: 13px;
    color: var(--ew-text-dark);
    text-transform: uppercase;
    text-align: left;
    border-bottom: 1px solid var(--ew-border);
}

.ew-specs-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.ew-specs-table tr:nth-child(even) {
    background: var(--ew-surface);
}

/* Videos Section */
.ew-demo-video-box h3 {
    font-size: 18px;
    font-weight: 800;
    color: var(--ew-text-dark);
    margin-bottom: 14px;
    border: none !important;
}

.ew-video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid var(--ew-border);
    cursor: pointer;
}

.ew-video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ew-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.ew-video-wrapper:hover .ew-play-overlay {
    background: rgba(0, 0, 0, 0.2);
}

.ew-installation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.ew-video-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ew-text-dark);
    margin-top: 8px;
}

/* =======================================
   REVIEWS SECTION
   ======================================== */

.ew-reviews-section {
    margin-top: 40px;
    border-top: 1px solid var(--ew-border);
    padding-top: 32px;
}

.ew-reviews-section h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--ew-text-dark);
    margin-bottom: 20px;
    border: none !important;
}

.ew-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.ew-review-card {
    background: var(--ew-surface);
    border: 1px solid var(--ew-border);
    border-radius: 14px;
    padding: 18px;
    border-left: 4px solid var(--ew-primary);
}

.ew-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ew-review-author {
    font-weight: 700;
    color: var(--ew-text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ew-review-avatar {
    width: 34px;
    height: 34px;
    background: var(--ew-primary-gradient);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.ew-review-date {
    font-size: 12px;
    color: var(--ew-text-muted);
}

.ew-review-stars {
    color: #f59e0b;
    font-size: 14px;
    margin-bottom: 8px;
}

.ew-review-text {
    color: #334155;
    font-size: 14px;
    line-height: 1.5;
}

.ew-review-form {
    background: var(--ew-surface);
    padding: 24px;
    border-radius: 14px;
    border: 1px solid var(--ew-border);
    margin-top: 24px;
}

.ew-form-title {
    color: var(--ew-text-dark);
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 800;
}

.ew-star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 6px;
    margin-bottom: 16px;
}

.ew-star-rating input {
    display: none;
}

.ew-star-rating label {
    font-size: 26px;
    color: #cbd5e1;
    cursor: pointer;
    transition: color 0.2s;
}

.ew-star-rating input:checked ~ label,
.ew-star-rating label:hover,
.ew-star-rating label:hover ~ label {
    color: #f59e0b;
}

.ew-input-group {
    margin-bottom: 14px;
}

.ew-input-group input,
.ew-input-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid var(--ew-border);
    border-radius: 10px;
    color: var(--ew-text-dark);
    font-family: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.ew-input-group textarea {
    min-height: 90px;
    resize: vertical;
}

.ew-submit-review {
    width: 100%;
    background: var(--ew-primary-gradient);
    color: #ffffff;
    font-weight: 800;
    padding: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: background 0.2s;
}

.ew-submit-review:hover {
    background: var(--ew-primary-hover);
}

/* ========================================
   CROSS-SELLING & RECOMMENDATIONS
   ======================================== */

.ew-cross-selling-section {
    margin-top: 40px;
    border-top: 1px solid var(--ew-border);
    padding-top: 32px;
}

.ew-cross-selling-section h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--ew-text-dark);
    margin-bottom: 20px;
    border: none !important;
}

.ew-cross-selling-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.ew-cross-card {
    background: #ffffff;
    border: 1px solid var(--ew-border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
}

.ew-cross-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--ew-shadow-md);
    border-color: var(--ew-primary);
}

.ew-cross-img-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--ew-surface);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
}

.ew-cross-img-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ew-cross-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

.ew-cross-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--ew-text-dark);
    margin: 0 0 8px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ew-cross-price {
    font-size: 16px;
    font-weight: 900;
    color: var(--ew-primary);
    margin-bottom: 12px;
}

.ew-cross-btn {
    width: 100%;
    padding: 10px;
    background: var(--ew-surface);
    color: var(--ew-text-dark);
    border: 1px solid var(--ew-border);
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ew-cross-btn:hover {
    background: var(--ew-primary);
    color: #ffffff;
    border-color: var(--ew-primary);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS (SMARTPHONE)
   ======================================== */

@media (max-width: 991px) {
    .ew-details-container {
        padding: 24px;
    }

    .ew-product-hero-grid {
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .ew-details-modal {
        padding: 0;
    }

    .ew-details-container {
        border-radius: 0;
        margin: 0;
        padding: 20px 16px;
        min-height: 100vh;
    }

    .ew-back-btn {
        top: 14px;
        right: 14px;
        width: 38px;
        height: 38px;
        font-size: 20px;
    }

    .ew-product-hero-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

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

    .ew-price-main {
        font-size: 28px;
    }

    .ew-reassurance-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .ew-benefits-grid {
        grid-template-columns: 1fr;
    }

    .ew-items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ew-cross-selling-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ew-installation-grid {
        grid-template-columns: 1fr;
    }

    .ew-cta-secondary-row {
        grid-template-columns: 1fr 1fr;
    }
}