/* =========================================================
   Ruman WhatsApp Shop — Frontend Styles
   Brand: #f5a623 (orange), #1a2035 (navy), #e8820c (dark orange)
   ========================================================= */

:root {
    --rws-orange:      #f5a623;
    --rws-orange-dark: #e8820c;
    --rws-navy:        #1a2035;
    --rws-navy-light:  #243050;
    --rws-white:       #ffffff;
    --rws-gray-light:  #f8f9fa;
    --rws-gray:        #e9ecef;
    --rws-gray-text:   #6c757d;
    --rws-text:        #2d3748;
    --rws-green:       #27ae60;
    --rws-red:         #e74c3c;
    --rws-shadow:      0 4px 24px rgba(26, 32, 53, 0.12);
    --rws-shadow-hover:0 12px 40px rgba(26, 32, 53, 0.22);
    --rws-radius:      12px;
    --rws-transition:  all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Wrapper ---- */
.rws-shop-wrapper {
    font-family: inherit;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---- Header ---- */
.rws-shop-header {
    text-align: center;
    margin-bottom: 48px;
    animation: rwsFadeUp 0.6s ease both;
}

.rws-header-badge {
    display: inline-block;
    background: rgba(245, 166, 35, 0.12);
    color: var(--rws-orange-dark);
    border: 1px solid rgba(245, 166, 35, 0.35);
    border-radius: 100px;
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.rws-shop-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    color: var(--rws-navy);
    margin: 0 0 14px;
    line-height: 1.2;
}

.rws-shop-subtitle {
    font-size: 16px;
    color: var(--rws-gray-text);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---- Filter Bar ---- */
.rws-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 40px;
    animation: rwsFadeUp 0.7s ease 0.1s both;
}

.rws-filter-btn {
    padding: 9px 22px;
    border: 1.5px solid var(--rws-gray);
    border-radius: 100px;
    background: var(--rws-white);
    color: var(--rws-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--rws-transition);
    outline: none;
}

.rws-filter-btn:hover,
.rws-filter-btn.active {
    background: var(--rws-orange);
    border-color: var(--rws-orange);
    color: var(--rws-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(245, 166, 35, 0.35);
}

/* ---- Product Grid ---- */
.rws-products-grid {
    display: grid;
    gap: 28px;
}

.rws-cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.rws-cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rws-cols-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---- Product Card ---- */
.rws-product-card {
    background: var(--rws-white);
    border-radius: var(--rws-radius);
    overflow: hidden;
    box-shadow: var(--rws-shadow);
    transition: var(--rws-transition);
    position: relative;
    border: 1px solid rgba(0,0,0,0.06);
}

.rws-product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--rws-shadow-hover);
}

/* Animate in on scroll */
.rws-animate-in {
    opacity: 0;
    transform: translateY(30px);
    animation: rwsFadeUp 0.55s ease both;
}

.rws-products-grid .rws-product-card:nth-child(1)  { animation-delay: 0.05s; }
.rws-products-grid .rws-product-card:nth-child(2)  { animation-delay: 0.10s; }
.rws-products-grid .rws-product-card:nth-child(3)  { animation-delay: 0.15s; }
.rws-products-grid .rws-product-card:nth-child(4)  { animation-delay: 0.20s; }
.rws-products-grid .rws-product-card:nth-child(5)  { animation-delay: 0.25s; }
.rws-products-grid .rws-product-card:nth-child(6)  { animation-delay: 0.30s; }
.rws-products-grid .rws-product-card:nth-child(7)  { animation-delay: 0.35s; }
.rws-products-grid .rws-product-card:nth-child(8)  { animation-delay: 0.40s; }
.rws-products-grid .rws-product-card:nth-child(n+9) { animation-delay: 0.45s; }

/* ---- Badge ---- */
.rws-card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--rws-orange);
    color: var(--rws-white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 100px;
    z-index: 2;
}

.rws-badge-out {
    background: var(--rws-red) !important;
    left: auto;
    right: 14px;
}

/* ---- Card Image ---- */
.rws-card-image {
    position: relative;
    overflow: hidden;
    height: 220px;
    background: var(--rws-gray-light);
}

.rws-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.rws-product-card:hover .rws-product-img {
    transform: scale(1.06);
}

.rws-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdc3cc;
    background: linear-gradient(135deg, #f0f2f5 0%, #e4e8ed 100%);
}

/* Card overlay with quick view */
.rws-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 32, 53, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--rws-transition);
}

.rws-product-card:hover .rws-card-overlay {
    opacity: 1;
}

.rws-quick-view {
    background: var(--rws-white);
    color: var(--rws-navy);
    border: none;
    padding: 10px 26px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transform: translateY(8px);
    transition: var(--rws-transition);
}

.rws-product-card:hover .rws-quick-view {
    transform: translateY(0);
}

.rws-quick-view:hover {
    background: var(--rws-orange);
    color: var(--rws-white);
}

/* ---- Card Body ---- */
.rws-card-body {
    padding: 20px;
}

.rws-card-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rws-orange-dark);
}

.rws-card-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--rws-navy);
    margin: 6px 0 8px;
    line-height: 1.3;
}

.rws-card-excerpt {
    font-size: 14px;
    color: var(--rws-gray-text);
    margin: 0 0 14px;
    line-height: 1.6;
}

.rws-card-price {
    margin-bottom: 16px;
}

.rws-price-amount {
    font-size: 22px;
    font-weight: 700;
    color: var(--rws-orange-dark);
}

.rws-price-unit {
    font-size: 14px;
    color: var(--rws-gray-text);
}

/* ---- Card Buttons ---- */
.rws-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rws-btn-details {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--rws-navy);
    border-radius: 8px;
    background: transparent;
    color: var(--rws-navy);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--rws-transition);
    white-space: nowrap;
}

.rws-btn-details:hover {
    background: var(--rws-navy);
    color: var(--rws-white);
}

.rws-btn-order {
    flex: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: #25d366;
    color: var(--rws-white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--rws-transition);
    white-space: nowrap;
}

.rws-btn-order:hover {
    background: #1ebe5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
}

.rws-btn-disabled {
    background: var(--rws-gray) !important;
    color: var(--rws-gray-text) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.rws-wa-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ---- Modal ---- */
.rws-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 30, 0.75);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.rws-modal-overlay.rws-active {
    opacity: 1;
    pointer-events: all;
}

.rws-modal {
    background: var(--rws-white);
    border-radius: 16px;
    width: 100%;
    max-width: 820px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}

.rws-modal-overlay.rws-active .rws-modal {
    transform: scale(1) translateY(0);
}

.rws-modal-close {
    position: sticky;
    top: 14px;
    float: right;
    margin: 14px 14px 0 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--rws-gray);
    color: var(--rws-navy);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: var(--rws-transition);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rws-modal-close:hover {
    background: var(--rws-navy);
    color: var(--rws-white);
}

.rws-modal-inner {
    padding: 24px 28px 32px;
    clear: both;
}

/* Modal product layout */
.rws-modal-product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.rws-modal-image img {
    width: 100%;
    border-radius: var(--rws-radius);
    object-fit: cover;
}

.rws-modal-no-img {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--rws-gray-light);
    border-radius: var(--rws-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bdc3cc;
}

.rws-modal-category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rws-orange-dark);
    margin-bottom: 8px;
}

.rws-modal-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--rws-navy);
    margin: 0 0 4px;
    line-height: 1.25;
}

.rws-modal-sku {
    font-size: 12px;
    color: var(--rws-gray-text);
    margin-bottom: 14px;
}

.rws-modal-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--rws-orange-dark);
    margin-bottom: 18px;
}

.rws-modal-price span {
    font-size: 15px;
    color: var(--rws-gray-text);
    font-weight: 400;
}

.rws-modal-desc {
    font-size: 15px;
    color: var(--rws-text);
    line-height: 1.7;
    margin-bottom: 18px;
}

.rws-modal-features {
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.rws-modal-features li {
    font-size: 14px;
    color: var(--rws-text);
    padding: 5px 0 5px 24px;
    position: relative;
    border-bottom: 1px solid var(--rws-gray);
}

.rws-modal-features li:last-child { border-bottom: none; }

.rws-modal-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rws-orange);
}

/* Quantity picker */
.rws-qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.rws-qty-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--rws-navy);
}

.rws-qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--rws-gray);
    border-radius: 8px;
    overflow: hidden;
}

.rws-qty-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--rws-gray-light);
    color: var(--rws-navy);
    font-size: 18px;
    cursor: pointer;
    transition: var(--rws-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rws-qty-btn:hover { background: var(--rws-orange); color: white; }

.rws-qty-input {
    width: 52px;
    height: 36px;
    border: none;
    border-left: 1.5px solid var(--rws-gray);
    border-right: 1.5px solid var(--rws-gray);
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--rws-navy);
    -moz-appearance: textfield;
    outline: none;
}

.rws-qty-input::-webkit-outer-spin-button,
.rws-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Notes field */
.rws-notes-row { margin-bottom: 20px; }
.rws-notes-row label { display: block; font-size: 14px; font-weight: 600; color: var(--rws-navy); margin-bottom: 6px; }
.rws-notes-row textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--rws-gray);
    border-radius: 8px;
    font-size: 14px;
    color: var(--rws-text);
    resize: vertical;
    min-height: 70px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.rws-notes-row textarea:focus { border-color: var(--rws-orange); }

/* Modal CTA */
.rws-modal-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    background: #25d366;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--rws-transition);
    letter-spacing: 0.02em;
}

.rws-modal-cta:hover {
    background: #1ebe5a;
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.45);
    transform: translateY(-2px);
}

.rws-modal-cta svg { width: 22px; height: 22px; }

/* ---- Loading Spinner ---- */
.rws-modal-loading {
    text-align: center;
    padding: 48px 24px;
    color: var(--rws-gray-text);
}

.rws-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--rws-gray);
    border-top-color: var(--rws-orange);
    border-radius: 50%;
    animation: rwsSpin 0.7s linear infinite;
    margin: 0 auto 16px;
}

/* ---- Filter hidden ---- */
.rws-product-card.rws-hidden {
    display: none;
}

/* ---- Animations ---- */
@keyframes rwsFadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes rwsSpin {
    to { transform: rotate(360deg); }
}

/* Orange top accent on cards */
.rws-product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rws-orange);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.rws-product-card:hover::after {
    transform: scaleX(1);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .rws-modal-product {
        grid-template-columns: 1fr;
    }
    .rws-cols-3,
    .rws-cols-4 {
        grid-template-columns: 1fr 1fr;
    }
    .rws-filter-bar { gap: 8px; }
    .rws-filter-btn { padding: 7px 16px; font-size: 13px; }
}

@media (max-width: 480px) {
    .rws-cols-2,
    .rws-cols-3,
    .rws-cols-4 {
        grid-template-columns: 1fr;
    }
    .rws-card-actions { flex-direction: column; }
    .rws-modal-inner { padding: 16px 18px 24px; }
}
