/**
 * Gulf Affiliate Module Styles
 *
 * Mobile-first CSS for:
 * - Affiliate Product Cards
 * - Product Comparison Table
 * - Comparison Bar
 * - Price Tables
 * - Buy Buttons
 * - Star Ratings
 *
 * @package Blurb
 * @since 2.0.0
 */

/* ============================================================
   1. AFFILIATE PRODUCT CARDS
   ============================================================ */

.gulf-product-grid {
    display: grid;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

.gulf-product-grid--1-cols { grid-template-columns: 1fr; }
.gulf-product-grid--2-cols { grid-template-columns: repeat(2, 1fr); }
.gulf-product-grid--3-cols { grid-template-columns: repeat(3, 1fr); }
.gulf-product-grid--4-cols { grid-template-columns: repeat(4, 1fr); }

.gulf-product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.gulf-product-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Image */
.gulf-product-card__image {
    position: relative;
    overflow: hidden;
    background: #f9fafb;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gulf-product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

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

.gulf-product-card__badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

/* Content */
.gulf-product-card__content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gulf-product-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.gulf-product-card__title a {
    color: #1f2937;
    text-decoration: none;
}

.gulf-product-card__title a:hover {
    color: #2563eb;
}

.gulf-product-card__description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

/* ============================================================
   2. PRICE TABLE
   ============================================================ */

.gulf-product-card__platforms {
    margin-top: auto;
}

.gulf-price-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.gulf-price-table thead th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gulf-price-row td {
    padding: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.gulf-price-row:last-child td {
    border-bottom: none;
}

.gulf-price-store {
    font-weight: 500;
}

.gulf-platform-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 0.25rem;
    vertical-align: middle;
    border-radius: 3px;
}

.gulf-platform-amazon { background: #ff9900; }
.gulf-platform-noon { background: #f9423a; }
.gulf-platform-aliexpress { background: #e62e04; }

.gulf-price-amount {
    font-weight: 700;
    color: #059669;
    white-space: nowrap;
}

.gulf-price-action {
    text-align: right;
}

.gulf-shipping-row td {
    padding: 0 0.5rem 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.gulf-shipping-info {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* ============================================================
   3. BUY BUTTONS
   ============================================================ */

.gulf-buy-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}

.gulf-buy-btn--amazon {
    background: #ff9900;
    color: #fff;
}

.gulf-buy-btn--amazon:hover {
    background: #e88f00;
    color: #fff;
}

.gulf-buy-btn--noon {
    background: #f9423a;
    color: #fff;
}

.gulf-buy-btn--noon:hover {
    background: #d6352e;
    color: #fff;
}

.gulf-buy-btn--aliexpress {
    background: #e62e04;
    color: #fff;
}

.gulf-buy-btn--aliexpress:hover {
    background: #c42703;
    color: #fff;
}

.gulf-buy-btn__arrow {
    font-size: 1rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.gulf-buy-btn:hover .gulf-buy-btn__arrow {
    transform: translateX(3px);
}

/* ============================================================
   4. STAR RATINGS
   ============================================================ */

.gulf-star-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.gulf-star {
    font-size: 1rem;
    line-height: 1;
}

.gulf-star--full { color: #f59e0b; }
.gulf-star--half { color: #f59e0b; opacity: 0.6; }
.gulf-star--empty { color: #d1d5db; }

.gulf-star-rating__value {
    margin-left: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
}

.gulf-product-card__review-count {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    color: #9ca3af;
}

/* ============================================================
   5. COMPARE BUTTON
   ============================================================ */

.gulf-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gulf-compare-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.gulf-compare-btn--active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.gulf-compare-btn--active:hover {
    background: #1d4ed8;
}

/* ============================================================
   6. STICKY COMPARE BAR
   ============================================================ */

.gulf-compare-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 2px solid #e5e7eb;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    padding: 0.75rem 1rem;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.gulf-compare-bar__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.gulf-compare-bar__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.gulf-compare-bar__items {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    overflow-x: auto;
    padding: 0.25rem 0;
}

.gulf-compare-bar__item {
    position: relative;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.gulf-compare-bar__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gulf-compare-bar__item-title {
    font-size: 0.625rem;
    display: block;
    padding: 0.25rem;
    text-align: center;
    color: #374151;
}

.gulf-compare-bar__remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: 2px solid #fff;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gulf-compare-bar__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.gulf-compare-bar__view {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.gulf-compare-bar__view:hover {
    background: #1d4ed8;
    color: #fff;
}

.gulf-compare-bar__clear {
    background: none;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
}

.gulf-compare-bar__clear:hover {
    color: #ef4444;
    border-color: #ef4444;
}

/* ============================================================
   7. COMPARISON TABLE (Full page)
   ============================================================ */

.gulf-compare-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    -webkit-overflow-scrolling: touch;
}

.gulf-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    min-width: 600px;
}

.gulf-compare-table th,
.gulf-compare-table td {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    text-align: center;
    vertical-align: middle;
}

.gulf-compare-feature-label {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    text-align: left;
    width: 140px;
    white-space: nowrap;
}

.gulf-compare-product-header {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-weight: 600;
    position: relative;
}

.gulf-compare-product-header a {
    color: #fff;
    text-decoration: none;
}

.gulf-compare-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gulf-compare-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

.gulf-compare-row--image img {
    max-width: 150px;
    height: auto;
}

.gulf-compare-row:nth-child(even) {
    background: #f9fafb;
}

.gulf-compare-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

/* ============================================================
   8. AFFILIATE DISCLOSURE & PRIVACY
   ============================================================ */

.gulf-affiliate-disclosure {
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.8rem;
    color: #92400e;
}

.gulf-affiliate-privacy-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1f2937;
    color: #f9fafb;
    padding: 0.75rem 1rem;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
}

.gulf-affiliate-privacy-notice p {
    margin: 0;
}

.gulf-affiliate-privacy-notice a {
    color: #60a5fa;
    text-decoration: underline;
}

.gulf-privacy-dismiss {
    background: none;
    border: 1px solid #6b7280;
    color: #f9fafb;
    border-radius: 4px;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
}

.gulf-privacy-dismiss:hover {
    background: #374151;
}

/* ============================================================
   9. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet: ≤ 1024px */
@media (max-width: 1024px) {
    .gulf-product-grid--4-cols { grid-template-columns: repeat(3, 1fr); }
}

/* Mobile landscape: ≤ 768px */
@media (max-width: 768px) {
    .gulf-product-grid--3-cols,
    .gulf-product-grid--4-cols { grid-template-columns: repeat(2, 1fr); }

    .gulf-compare-bar__inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .gulf-compare-bar__items {
        width: 100%;
    }

    .gulf-compare-bar__actions {
        width: 100%;
        justify-content: space-between;
    }

    .gulf-compare-table {
        font-size: 0.75rem;
    }

    .gulf-compare-table th,
    .gulf-compare-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Mobile portrait: ≤ 480px */
@media (max-width: 480px) {
    .gulf-product-grid--2-cols,
    .gulf-product-grid--3-cols,
    .gulf-product-grid--4-cols { grid-template-columns: 1fr; }

    .gulf-product-card__title {
        font-size: 0.9rem;
    }

    .gulf-buy-btn {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}